[FIX] stock: wrong default date with inventory at date
When choosing inventory at specific date the default value is the start time of the server instead of the current time. When using fields.Datetime.now as default value, will set the function as default and future object will need to evaluate the funcion each time an object without default is created. fields.Datetime.now() will evaluate the function once at the server start and use the retun value as default value for future objects.
This commit is contained in:
@@ -12,7 +12,7 @@ class StockQuantityHistory(models.TransientModel):
|
||||
(0, 'Current Inventory'),
|
||||
(1, 'At a Specific Date')
|
||||
], string="Compute", help="Choose to analyze the current inventory or from a specific date in the past.")
|
||||
date = fields.Datetime('Inventory at Date', help="Choose a date to get the inventory at that date", default=fields.Datetime.now())
|
||||
date = fields.Datetime('Inventory at Date', help="Choose a date to get the inventory at that date", default=fields.Datetime.now)
|
||||
|
||||
def open_table(self):
|
||||
self.ensure_one()
|
||||
|
||||
Reference in New Issue
Block a user