diff --git a/addons/account/models/account_bank_statement.py b/addons/account/models/account_bank_statement.py
index 377eae58acc..158a5a0404e 100644
--- a/addons/account/models/account_bank_statement.py
+++ b/addons/account/models/account_bank_statement.py
@@ -821,6 +821,9 @@ class AccountBankStatementLine(models.Model):
}
st_line.process_reconciliation(new_aml_dicts=[vals])
+ def _get_communication(self, payment_method_id):
+ return self.name or ''
+
def process_reconciliation(self, counterpart_aml_dicts=None, payment_aml_rec=None, new_aml_dicts=None):
""" Match statement lines with existing payments (eg. checks) and/or payables/receivables (eg. invoices and refunds) and/or new move lines (eg. write-offs).
If any new journal item needs to be created (via new_aml_dicts or counterpart_aml_dicts), a new journal entry will be created and will contain those
@@ -918,7 +921,7 @@ class AccountBankStatementLine(models.Model):
'state': 'reconciled',
'currency_id': currency.id,
'amount': abs(total),
- 'communication': self.name or '',
+ 'communication': self._get_communication(payment_methods[0] if payment_methods else False),
'name': self.statement_id.name,
})
diff --git a/addons/mrp/views/mrp_production_views.xml b/addons/mrp/views/mrp_production_views.xml
index 240307f27d6..f64bc301229 100644
--- a/addons/mrp/views/mrp_production_views.xml
+++ b/addons/mrp/views/mrp_production_views.xml
@@ -89,7 +89,7 @@
+ string="Update" states="confirmed,planned,progress" class="oe_link"/>
ALL(%%s)" % (comodel._table, inverse)
- comodel._cr.execute(query, (record.id, act[2] or [0]))
- lines = comodel.browse([row[0] for row in comodel._cr.fetchall()])
+ domain = self.domain(records) if callable(self.domain) else self.domain
+ domain = domain + [(inverse, 'in', records.ids), ('id', 'not in', act[2] or [0])]
inverse_field = comodel._fields[inverse]
if inverse_field.ondelete == 'cascade':
- lines.unlink()
+ comodel.search(domain).unlink()
else:
- lines.write({inverse: False})
+ comodel.search(domain).write({inverse: False})
class Many2many(_RelationalMulti):