Skip to content

Commit

Permalink
add department do portfolio constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
lepistone committed Mar 3, 2015
1 parent 4f3dff8 commit 9d7c6dd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions framework_agreement_department/model/portfolio.py
Expand Up @@ -27,3 +27,10 @@ def _get_my_department(self):

department_id = fields.Many2one('hr.department', 'Department',
default=_get_my_department)

_sql_constraints = [
('uniq_portfolio',
'unique(supplier_id, company_id, department_id)',
'There can be only one portfolio '
'per supplier, department and company.'),
]

0 comments on commit 9d7c6dd

Please sign in to comment.