[FIX] account_payment: The payment line name must be unique per company

Closes #16366

Steps to reproduce the problem:
 - create 2 company
 - create 2 different sequences 'payment line', one for company
 - create a payment order for company A and insert a line
 - create a payment order for company B and insert a line
Get SQL error saying The payment line name must be unique
This commit is contained in:
eLBati 2017-04-11 10:27:25 +02:00 committed by Yannick Tivisse
parent e40cad3560
commit d6cf41b67b
1 changed files with 1 additions and 1 deletions

View File

@ -329,7 +329,7 @@ class payment_line(osv.osv):
'date': _get_date,
}
_sql_constraints = [
('name_uniq', 'UNIQUE(name)', 'The payment line name must be unique!'),
('name_uniq', 'UNIQUE(name, company_id)', 'The payment line name must be unique per company!'),
]
def onchange_move_line(self, cr, uid, ids, move_line_id, payment_type, date_prefered, date_scheduled, currency=False, company_currency=False, context=None):