[FIX] point_of_sale: do not read undefined fields

Oversight of previous forward-port.
This commit is contained in:
Christophe Simonis
2017-04-27 12:00:55 +02:00
parent 595b38fbdc
commit bf23946e3d
+2 -2
View File
@@ -334,11 +334,11 @@ class PosOrder(models.Model):
def _reconcile_payments(self):
for order in self:
aml = order.statement_ids.mapped('journal_entry_ids').mapped('line_ids') | order.account_move.line_ids | order.invoice_id.move_id.line_ids
aml = order.statement_ids.mapped('journal_entry_ids') | order.account_move.line_ids | order.invoice_id.move_id.line_ids
aml = aml.filtered(lambda r: not r.reconciled and r.account_id.internal_type == 'receivable' and r.partner_id == order.partner_id.commercial_partner_id)
try:
aml.reconcile()
except:
except Exception:
# There might be unexpected situations where the automatic reconciliation won't
# work. We don't want the user to be blocked because of this, since the automatic
# reconciliation is introduced for convenience, not for mandatory accounting