Include latest move and next depreciation as update date

issue10342
review334251002
This commit is contained in:
Cédric Krier committed 2021-04-28 00:37:26 +02:00
1 parent ecb240d1e6
commit 8fda5d34f3
1 file changed
+3 -3
+3 -3
View File
@@ -811,8 +811,8 @@ class UpdateAssetShowDepreciation(ModelView):
amount = fields.Numeric('Amount', readonly=True)
date = fields.Date('Date', required=True,
domain=[
('date', '>', Eval('latest_move_date')),
('date', '<', Eval('next_depreciation_date')),
('date', '>=', Eval('latest_move_date')),
('date', '<=', Eval('next_depreciation_date')),
],
depends=['latest_move_date', 'next_depreciation_date'],
help=('The date must be between the last update/depreciation date '
@@ -915,7 +915,7 @@ class UpdateAsset(Wizard):
latest_move_date = self.show_move.latest_move_date
next_date = self.show_move.next_depreciation_date
if not (latest_move_date < self.show_move.date < next_date):
if not (latest_move_date <= self.show_move.date <= next_date):
raise ValueError('The update move date is invalid')
move = self.get_move(self.record)
move.lines = self.get_move_lines(self.record)