Guest User

Untitled

a guest
Jan 16th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. @api.onchange('bom_line_ids')
  2. def get_excl_list(self):
  3.  
  4. list1 = []
  5. for i in self.excl_list:
  6. list1.append(i.id)
  7.  
  8. list2 = []
  9. for j in self.bom_line_ids:
  10. list2.append(j.product_id.id)
  11.  
  12. if j.product_id.id in list1:
  13. warning_message = "Product: " + self.env['product.template'].search([('id','=',j.product_id.id)]).name + " can't be added to the BoM.n Please select another product."
  14. print "self.bom_line_ids.product_id", self.bom_line_ids.product_id
  15. self.bom_line_ids.product_id = False
  16. print "self.bom_line_ids.product_id", self.bom_line_ids.product_id
  17.  
  18. return { 'warning': {'title': 'Product error', 'message':warning_message} }
  19.  
  20. self.bom_line_ids.product_id = False
  21.  
  22. j.product_id = False
  23.  
  24. self.bom_line_ids[self.bom_line_ids.index(j)].product_id = False
  25.  
  26. job_titles = fields.Char('Job',compute='myemply_name',store=True)
  27.  
  28. @api.onchange('new_empl')
  29. @api.depends('new_empl')
  30. def myemply_name(self):
  31. self.job_titles = value
Add Comment
Please, Sign In to add comment