stock_valuation_xlsx: fix crash with using depreciation rules
This commit is contained in:
@@ -145,7 +145,7 @@ class StockValuationXlsx(models.TransientModel):
|
|||||||
def _prepare_expiry_depreciation_rules(self, company_id, past_date):
|
def _prepare_expiry_depreciation_rules(self, company_id, past_date):
|
||||||
rules = self.env['stock.expiry.depreciation.rule'].search_read([('company_id', '=', company_id)], ['start_limit_days', 'ratio'], order='start_limit_days desc')
|
rules = self.env['stock.expiry.depreciation.rule'].search_read([('company_id', '=', company_id)], ['start_limit_days', 'ratio'], order='start_limit_days desc')
|
||||||
if past_date:
|
if past_date:
|
||||||
date_dt = past_date
|
date_dt = fields.Date.to_date(past_date) # convert datetime to date
|
||||||
else:
|
else:
|
||||||
date_dt = fields.Date.context_today(self)
|
date_dt = fields.Date.context_today(self)
|
||||||
for rule in rules:
|
for rule in rules:
|
||||||
|
|||||||
Reference in New Issue
Block a user