| 
						
						
						
					 | 
					@ -1,7 +1,7 @@ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					/** @odoo-module */ | 
					 | 
					 | 
					/** @odoo-module */ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import { patch } from "@web/core/utils/patch"; | 
					 | 
					 | 
					import { patch } from "@web/core/utils/patch"; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					import { Orderline } from "@point_of_sale/app/store/models"; | 
					 | 
					 | 
					import { Orderline, Order } from "@point_of_sale/app/store/models"; | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					patch(Orderline.prototype, { | 
					 | 
					 | 
					patch(Orderline.prototype, { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    export_as_JSON(){ | 
					 | 
					 | 
					    export_as_JSON(){ | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -17,10 +17,12 @@ patch(Orderline.prototype, { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    init_from_JSON(json){ | 
					 | 
					 | 
					    init_from_JSON(json){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        super.init_from_JSON(...arguments); | 
					 | 
					 | 
					        super.init_from_JSON(...arguments); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        // Set the product_uom_id from the JSON data
 | 
					 | 
					 | 
					        // Set the product_uom_id from the JSON data
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        if(this.pos.units_by_id[json.product_uom_id]){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        this.product_uom_id = { | 
					 | 
					 | 
					        this.product_uom_id = { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            0 : this.pos.units_by_id[json.product_uom_id].id, | 
					 | 
					 | 
					            0 : this.pos.units_by_id[json.product_uom_id].id, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            1 : this.pos.units_by_id[json.product_uom_id].name, | 
					 | 
					 | 
					            1 : this.pos.units_by_id[json.product_uom_id].name, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        }; | 
					 | 
					 | 
					        }; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    }, | 
					 | 
					 | 
					    }, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    // Add a custom set_uom method
 | 
					 | 
					 | 
					    // Add a custom set_uom method
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    set_uom(uom_id){ | 
					 | 
					 | 
					    set_uom(uom_id){ | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -75,3 +77,10 @@ patch(Orderline.prototype, { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        }; | 
					 | 
					 | 
					        }; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    }, | 
					 | 
					 | 
					    }, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					}); | 
					 | 
					 | 
					}); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					patch(Order.prototype, { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    export_for_printing() { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        var result = super.export_for_printing(...arguments); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        result['orderlines'] =  result['orderlines'].map(({ onSelectionChangedUom, ...rest }) => rest); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        return result; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    }, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					}); |