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
@api.depends('product_id.product_tmpl_id.type')
def _niu_validation(self):
if product_id.product_tmpl_id.type == 'service':
sequence= self.env['ir.sequence'].next_by_code('sale.order.line')
return super(SaleOrderLine,self)