changeset ba53735d7fdf in modules/stock:default
details: https://hg.tryton.org/modules/stock?cmd=changeset&node=ba53735d7fdf
description:
Allow modifying currency on move from closed period
issue11753
review415691003
diffstat:
move.py | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diffs (28 lines):
diff -r 92ab6b78b29b -r ba53735d7fdf move.py
--- a/move.py Sun Oct 02 00:32:32 2022 +0200
+++ b/move.py Sun Oct 09 13:17:46 2022 +0200
@@ -305,11 +305,11 @@
('type', 'in', cls.get_product_types()),
]
cls._deny_modify_assigned = set(['product', 'uom', 'quantity',
- 'from_location', 'to_location', 'company', 'currency'])
+ 'from_location', 'to_location', 'company'])
cls._deny_modify_done_cancel = (cls._deny_modify_assigned
| set(['planned_date', 'effective_date', 'state']))
cls._allow_modify_closed_period = {
- 'cost_price', 'unit_price', 'unit_price_updated'}
+ 'cost_price', 'unit_price', 'unit_price_updated', 'currency'}
t = cls.__table__()
cls._sql_constraints += [
@@ -837,7 +837,9 @@
to_write.extend(([move], {
'internal_quantity': internal_quantity,
}))
- if move.state == 'done' and 'unit_price' in values:
+ if (move.state == 'done'
+ and ('unit_price' in values
+ or 'currency' in values)):
unit_price_update.append(move)
if to_write: