mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
[MRG][FIX] account_statement_ext: unwind related and stored field because it does not work in a constraint in YAML test, for some reason.This probably needs a more general solution.
This commit is contained in:
@@ -223,12 +223,17 @@ class AccountBankSatement(Model):
|
|||||||
move of period_id to the statement line
|
move of period_id to the statement line
|
||||||
"""
|
"""
|
||||||
for statement in self.browse(cr, uid, ids, context=context):
|
for statement in self.browse(cr, uid, ids, context=context):
|
||||||
|
# statement.company_id is a related store=True that for some
|
||||||
|
# reason doesn't work in YAML tests. As a workaround, I unwind it
|
||||||
|
# to statement.journal_id.company_id here.
|
||||||
if (statement.period_id and
|
if (statement.period_id and
|
||||||
statement.company_id.id != statement.period_id.company_id.id):
|
statement.journal_id.company_id.id !=
|
||||||
|
statement.period_id.company_id.id):
|
||||||
return False
|
return False
|
||||||
for line in statement.line_ids:
|
for line in statement.line_ids:
|
||||||
if (line.period_id and
|
if (line.period_id and
|
||||||
statement.company_id.id != line.period_id.company_id.id):
|
statement.journal_id.company_id.id
|
||||||
|
!= line.period_id.company_id.id):
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user