diff options
| author | Arnold Moyaux <arm@odoo.com> | 2017-11-13 16:55:36 +0100 |
|---|---|---|
| committer | Arnold Moyaux <arm@odoo.com> | 2017-11-13 17:33:17 +0100 |
| commit | 6b7ac1c5d71f8d18da68040e6035a2af8eca71e2 (patch) | |
| tree | f2d01f19813b75eb298881a0f77dc8a194017447 | |
| parent | 8900dc22048d460b44b6b308f88f2737cac5b4ba (diff) | |
[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.
| -rw-r--r-- | addons/stock/wizard/stock_quantity_history.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/stock/wizard/stock_quantity_history.py b/addons/stock/wizard/stock_quantity_history.py index 16dee8b4de1..e138bce9bb3 100644 --- a/addons/stock/wizard/stock_quantity_history.py +++ b/addons/stock/wizard/stock_quantity_history.py @@ -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() |
