Browse Source

May 09: [FIX] Bug Fixed 'product_multi_uom_pos'

pull/317/head
RisvanaCybro 12 months ago
parent
commit
386d985fb5
  1. 2
      product_multi_uom_pos/__manifest__.py
  2. 5
      product_multi_uom_pos/doc/RELEASE_NOTES.md
  3. 1
      product_multi_uom_pos/models/product_template.py
  4. 3
      product_multi_uom_pos/static/src/overrides/generic_components/orderline/orderline.xml
  5. 11
      product_multi_uom_pos/static/src/overrides/models/orderline.js

2
product_multi_uom_pos/__manifest__.py

@ -21,7 +21,7 @@
############################################################################# #############################################################################
{ {
'name': "POS Product Multiple UOM", 'name': "POS Product Multiple UOM",
'version': '17.0.1.0.0', 'version': '17.0.1.0.1',
'category': 'Point of Sale', 'category': 'Point of Sale',
'summary': """A module to manage multiple UoM in POS""", 'summary': """A module to manage multiple UoM in POS""",
'description': """Using this app, you can change unit of measure of 'description': """Using this app, you can change unit of measure of

5
product_multi_uom_pos/doc/RELEASE_NOTES.md

@ -4,3 +4,8 @@
#### Version 17.0.1.0.0 #### Version 17.0.1.0.0
#### ADD #### ADD
- Initial commit for POS Product Multiple UOM - Initial commit for POS Product Multiple UOM
#### 9.05.2024
#### Version 17.0.1.0.1
##### UPDT
- Bug Fix-Resolved the issue in the refund page.

1
product_multi_uom_pos/models/product_template.py

@ -43,6 +43,7 @@ class ProductTemplate(models.Model):
""" """
status = self.env['ir.config_parameter'].sudo().get_param( status = self.env['ir.config_parameter'].sudo().get_param(
'product_multi_uom_pos.pos_multi_uom') 'product_multi_uom_pos.pos_multi_uom')
print(status,'status')
self.write({ self.write({
'multi_uom': status 'multi_uom': status
}) })

3
product_multi_uom_pos/static/src/overrides/generic_components/orderline/orderline.xml

@ -5,8 +5,7 @@
t-inherit="point_of_sale.Orderline" t-inherit="point_of_sale.Orderline"
t-inherit-mode="extension" owl="1"> t-inherit-mode="extension" owl="1">
<xpath expr="//ul[hasclass('info-list')]" position="after"> <xpath expr="//ul[hasclass('info-list')]" position="after">
<t t-if="line.getUom(this).length != 0"> <t t-if="line.onSelectionChangedUom and line.getUom(this).length != 0">
<t t-log="this"/>
<button id="reset_uom" style="margin-top: 15px; background:transparent;border:transparent; <button id="reset_uom" style="margin-top: 15px; background:transparent;border:transparent;
margin-bottom: 5px;margin-left: 180px;" margin-bottom: 5px;margin-left: 180px;"
t-on-click="line.resetUom"> t-on-click="line.resetUom">

11
product_multi_uom_pos/static/src/overrides/models/orderline.js

@ -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;
},
});
Loading…
Cancel
Save