Browse Source

Mar 15 [UPDT] : Updated 'product_multi_uom_pos'

pull/313/head
AjmalCybro 1 year ago
parent
commit
dad77f7adc
  1. 2
      product_multi_uom_pos/__manifest__.py
  2. 5
      product_multi_uom_pos/doc/RELEASE_NOTES.md
  3. 11
      product_multi_uom_pos/models/pos_order_line.py
  4. 2
      product_multi_uom_pos/static/src/overrides/generic_components/orderline/orderline.xml
  5. 14
      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.1', 'version': '17.0.1.0.0',
'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,8 +4,3 @@
#### 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
#### 12.02.2024
#### Version 17.0.1.0.1
#### UPDATE
- Removed buttons from receipt.

11
product_multi_uom_pos/models/pos_order_line.py

@ -39,3 +39,14 @@ class PosOrderLine(models.Model):
if values.get('product_uom_id'): if values.get('product_uom_id'):
values['uom_id'] = int(values['product_uom_id']) values['uom_id'] = int(values['product_uom_id'])
return super().create(values) return super().create(values)
def _export_for_ui(self, orderline):
"""Extends the base '_export_for_ui' method to include the
'product_uom_id' field in the exported data.
:param orderline: The POS order line.
:return: Dictionary with additional data for UI export."""
result = super()._export_for_ui(orderline)
result.update({
'product_uom_id': orderline.product_uom_id.id,
})
return result

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

@ -5,7 +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 and props.line.resetUom"> <t t-if="line.getUom(this).length != 0">
<t t-log="this"/> <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;"

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

@ -2,7 +2,6 @@
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 } from "@point_of_sale/app/store/models";
import { Order } from "@point_of_sale/app/store/models";
patch(Orderline.prototype, { patch(Orderline.prototype, {
export_as_JSON(){ export_as_JSON(){
@ -76,16 +75,3 @@ patch(Orderline.prototype, {
}; };
}, },
}); });
patch(Order.prototype, {
/**
* Extends the export_for_printing method to customize the printing data.
* Removes the 'showPricelist' property from each order line.
* @returns {Object} The modified printing data.
*/
export_for_printing() {
const result = super.export_for_printing(...arguments);
result['orderlines'] = result['orderlines'].map(({ ["resetUom"]: _, ...rest }) => rest);
return result;
},
});
Loading…
Cancel
Save