'state': 'draft',
}
_order = "date_start, special desc"
-
+ _sql_constraints = [
+ ('name_company_uniq', 'unique(name, company_id)', 'The name of the period must be unique per company !'),
+ ]
+
def _check_duration(self,cr,uid,ids,context=None):
obj_period = self.browse(cr, uid, ids[0], context=context)
if obj_period.date_stop < obj_period.date_start:
'type_tax_use': fields.selection([('sale','Sale'),('purchase','Purchase'),('all','All')], 'Tax Application', required=True)
}
+ _sql_constraints = [
+ ('name_company_uniq', 'unique(name, company_id)', 'Tax Name must be unique per company!'),
+ ]
def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=80):
"""
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'hr.job', context=c),
'state': 'open',
}
+
+ _sql_constraints = [
+ ('name_company_uniq', 'unique(name, company_id)', 'The name of the job position must be unique per company !'),
+ ]
+
def on_change_expected_employee(self, cr, uid, ids, no_of_recruitment, no_of_employee, context=None):
if context is None:
self.pool.get('res.users').browse(cr, uid, uid,
context=context).company_id.id,
}
+ _sql_constraints = [
+ ('code_uniq', 'unique(code)', 'The code of salary rule category must be unique!'),
+ ]
hr_salary_rule_category()
'amount_percentage': 0.0,
'quantity': '1.0',
}
+
+ _sql_constraints = [
+ ('code_uniq', 'unique(code)', 'The code of salary rule must be unique!'),
+ ]
def _recursive_search_of_rules(self, cr, uid, rule_ids, context=None):
"""
<record id="hr_salary_rule_ca_paolino" model="hr.salary.rule">
<field name="amount_select">fix</field>
<field eval="600.0" name="amount_fix"/>
- <field name="code">CA</field>
+ <field name="code">CAQP</field>
<field name="category_id" ref="hr_payroll.ALW"/>
<field name="name">Conveyance Allowance For Paolino</field>
<field name="sequence" eval="15"/>
_defaults = {
'sequence': 1,
}
+ _sql_constraints = [
+ ('name_uniq', 'unique (name)', 'The name of the Degree of Recruitment must be unique!')
+ ]
hr_recruitment_degree()
class hr_applicant(crm.crm_case, osv.osv):
_constraints = [
(_check_uom, 'Error: The default UOM and the purchase UOM must be in the same category.', ['uom_id']),
]
+ _sql_constraints = [
+ ('name_ref_uniq', 'unique(name, company_id)', 'The name of the product must be unique per company!'),
+ ]
def name_get(self, cr, user, ids, context=None):
if context is None: