This question has been flagged
1146 Views

 @api.constrains('line_ids')    def_check_exist_product_in_line(self):        err_products = []        # res = super(MybodyLine, self.line_ids).browse()        # if  self.line_ids:
        #         # return warning message
        #         raise ValidationError(_(f"No Journal Items {self.line_ids.name_sas.name}"))
        # return res                list_vali=[]        list_repe=[]            forlineinself.line_ids.name_sas :            # if line.id not in err_products:                forcopyinself.line_ids.name_sas:                    list_vali.append(copy.name)
                # # for copye in self.repito.name:                #     list_repe.append(self.repito ==self.line_ids.name_sas)
                ifline.name == list_vali:                     raiseexceptions.Warning(f" This field is already placed {line.name}, {list_vali}")                else :                    # pass                    err_products.append(line.id)                    raiseexceptions.Warning(_(f' {line.name} , {list_vali} ,{list_repe}'))                # else:            #     raise exceptions.Warning(_(' Exist'))

 I want to place a part of the body I bone a neck and an arm but the system does not validate if I add another neck in a line_ids

Avatar
Discard