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 | etc.
Hello, I have a function that should validate that a product is of type ' Service' . When this condition is met the ' sequence' field must increase its value sequentially. This method is written in the sale.order.line model.
Please if this function is badly implemented , tell me I can do to correct it.
I hope tips and suggestions thank you very much. Thanks
if product_id.product_tmpl_id.type == 'service':
No return is needed from that function and you should use self.product_id if you call it that function using a recordset(also take care of multiple records in the recorset like iterate over self) or pass the product_id to the function if you call the function directly, like:
def _niu_validation(self, product_id):
if product_id.type == 'service':
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 2/26/16, 3:45 PM|
|Seen: 845 times|
|Last updated: 2/26/16, 4:10 PM|