summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorLaurent Smet <las@odoo.com>2019-11-26 09:54:17 +0000
committerLaurent Smet <las@odoo.com>2019-11-26 09:54:17 +0000
commit2dc2c20fe59200c4dde66f1a0662669ef1f12f1a (patch)
treea7edc1bfb7bbd8924f94a79df306f5c6ca763de9 /addons
parentc428e0aa681e01a106a04d853cbe22573c450425 (diff)
[FIX] account: Fix missing dependencies of _check_duplicate_supplier_reference
- Create a vendor bill for partner A with reference 'AAAAA' - Create another vendor bill for partner A with the same reference: => Constraint is triggered. - Create another vendor bill without partner with the same reference. - Edit the vendor bill and set a partner: => Constraint not triggered. closes odoo/odoo#40897 X-original-commit: 3f6254c8faa7dfb2484f4ac18d4c0fd717149e4b Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/account/models/account_move.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py
index 5a21e336d86..748fb5b1586 100644
--- a/addons/account/models/account_move.py
+++ b/addons/account/models/account_move.py
@@ -1339,7 +1339,7 @@ class AccountMove(models.Model):
if res:
raise ValidationError(_('Posted journal entry must have an unique sequence number per company.'))
- @api.constrains('ref')
+ @api.constrains('ref', 'type', 'partner_id', 'journal_id', 'invoice_date')
def _check_duplicate_supplier_reference(self):
moves = self.filtered(lambda move: move.is_purchase_document() and move.ref)
if not moves: