Browse Source

[FIX] add back company_id field

pull/287/head
Yves Goldberg 6 years ago
committed by GitHub
parent
commit
03b4967853
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      agreement/models/agreement.py

8
agreement/models/agreement.py

@ -14,6 +14,10 @@ class Agreement(models.Model):
partner_id = fields.Many2one(
'res.partner', string='Partner', ondelete='restrict', required=True,
domain=[('parent_id', '=', False)])
company_id = fields.Many2one(
'res.company', string='Company',
default=lambda self: self.env['res.company']._company_default_get(
'agreement'))
active = fields.Boolean(default=True)
signature_date = fields.Date()
start_date = fields.Date()
@ -29,7 +33,7 @@ class Agreement(models.Model):
return res
_sql_constraints = [(
'code_partner_unique',
'unique(code, partner_id)',
'code_partner_company_unique',
'unique(code, partner_id, company_id)',
'This agreement code already exists for this partner!'
)]
Loading…
Cancel
Save