Default value not set on production moves
I have the following and also the field displayed on form view:
from decimal import Decimal
from trytond.modules.product import price_digits
from trytond.model import fields
from trytond.pool import PoolMeta
class Move(metaclass=PoolMeta):
__name__ = 'stock.move'
foo = fields.Numeric("Foo", digits=price_digits)
@classmethod
def default_foo(cls):
return Decimal(10)
Scenario 1. Steps to reproduce:
- Create a production
- Select product, bom, and quantity, save.
Result: The moves have no value for foo. This is WRONG
Other tests that I made:
Scenario 2.
- Close the last production tab.
- Open the production
- Find the production from scenario 1
- Change production quantity.
- Save production.
Result: The foo field from moves have value. This is OK.
Scenario 3.
- Close the last production tab.
- Open the production
- Find the production from scenario 2
- Double click to see the input move, close the move window without changing any value.
- Change production quantity.
- Save production.
Result: The input moves have no value for foo. This is also WRONG
The error can be reproducible the same way in both clients.
Edited by Adrià Tarroja Caubet