At least add a row for old logic to work properly
This commit is contained in:
		
							parent
							
								
									c819ea38a0
								
							
						
					
					
						commit
						127b3f552b
					
				| @ -128,6 +128,7 @@ class Item(WebsiteGenerator): | ||||
| 		self.validate_uom_conversion_factor() | ||||
| 		self.validate_item_defaults() | ||||
| 		self.update_defaults_from_item_group() | ||||
| 		self.update_defaults_add_company() | ||||
| 
 | ||||
| 		if not self.get("__islocal"): | ||||
| 			self.old_item_group = frappe.db.get_value(self.doctype, self.name, "item_group") | ||||
| @ -135,6 +136,10 @@ class Item(WebsiteGenerator): | ||||
| 					from `tabWebsite Item Group` | ||||
| 					where parentfield='website_item_groups' and parenttype='Item' and parent=%s""", self.name) | ||||
| 
 | ||||
| 	def update_defaults_add_company(self): | ||||
| 		if not self.item_defaults: | ||||
| 				self.append("item_defaults", {"company": frappe.defaults.get_defaults().company}) | ||||
| 
 | ||||
| 	def on_update(self): | ||||
| 		invalidate_cache_for_item(self) | ||||
| 		self.validate_name_with_item_group() | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user