i want to place constraint on number of task a user can create in te model project limiting it to 5 depending on if te task is done normal or blocked can i have an example of script please .
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
1
Reply
1400
Views
override create a method of project.task like
def create(self, vals):
project_id = self.get('project_id')
project = self.env['project.project'].browse(project_id)
if len(project.task_ids) > 6:
raise UserError(_('Not allow to create more than 5 task in project'))
return super(ProjectTask, self).create(vals)
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up
not workin error
'project.task' object has no attribute 'self'
Override odoo functions: https://goo.gl/4BkizH