Browse Source

Aug 20 [UPDT] Updated 'laundry_management_pos'

pull/332/merge
AjmalCybro 8 months ago
parent
commit
4f15501a88
  1. 6
      laundry_management_pos/__manifest__.py
  2. 6
      laundry_management_pos/doc/RELEASE_NOTES.md
  3. 1
      laundry_management_pos/models/__init__.py
  4. 4
      laundry_management_pos/models/pos_order.py
  5. 25
      laundry_management_pos/static/src/js/screen/payment_screen.js
  6. 43
      laundry_management_pos/static/src/js/screen/product_screen.js
  7. 7
      laundry_management_pos/static/src/xml/pos_receipt.xml

6
laundry_management_pos/__manifest__.py

@ -20,7 +20,7 @@
############################################################################## ##############################################################################
{ {
'name': "POS Laundry Management", 'name': "POS Laundry Management",
'version': '16.0.1.0.0', 'version': '16.0.1.0.1',
'category': 'Point of Sale', 'category': 'Point of Sale',
'summary': """Launch Automatic Laundry Orders After selling Through POS.""", 'summary': """Launch Automatic Laundry Orders After selling Through POS.""",
'description': """It manages the Point of sale laundry process with assigning works to workers.We can create 'description': """It manages the Point of sale laundry process with assigning works to workers.We can create
@ -50,12 +50,12 @@
'laundry_management_pos/static/src/xml/pos_receipt.xml', 'laundry_management_pos/static/src/xml/pos_receipt.xml',
'laundry_management_pos/static/src/js/product_img.js', 'laundry_management_pos/static/src/js/product_img.js',
'laundry_management_pos/static/src/xml/product_img.xml', 'laundry_management_pos/static/src/xml/product_img.xml',
'laundry_management_pos/static/src/js/screen/product_screen.js',
'laundry_management_pos/static/src/css/pos.css', 'laundry_management_pos/static/src/css/pos.css',
'laundry_management_pos/static/src/xml/button/product_create_button.xml', 'laundry_management_pos/static/src/xml/button/product_create_button.xml',
'laundry_management_pos/static/src/js/button/product_create_button.js', 'laundry_management_pos/static/src/js/button/product_create_button.js',
'laundry_management_pos/static/src/js/screen/product_create_popup.js', 'laundry_management_pos/static/src/js/screen/product_create_popup.js',
'laundry_management_pos/static/src/xml/screen/product_create_popup.xml' 'laundry_management_pos/static/src/xml/screen/product_create_popup.xml',
'laundry_management_pos/static/src/js/screen/payment_screen.js',
], ],
}, },
'images': ['static/description/banner.png'], 'images': ['static/description/banner.png'],

6
laundry_management_pos/doc/RELEASE_NOTES.md

@ -4,3 +4,9 @@
#### Version 16.0.1.0.0 #### Version 16.0.1.0.0
#### ADD #### ADD
- Initial commit for POS Laundry Management - Initial commit for POS Laundry Management
#### 13.08.2024
#### Version 16.0.1.0.1
#### UPDT
- Bug Fix - Addressed the issue that occurred when a partner was not selected for a laundry order.

1
laundry_management_pos/models/__init__.py

@ -22,4 +22,3 @@ from . import laundry_order
from . import pos_config from . import pos_config
from . import pos_order from . import pos_order

4
laundry_management_pos/models/pos_order.py

@ -90,12 +90,12 @@ class PosOrder(models.Model):
if order: if order:
order_id = order[0]['id'] order_id = order[0]['id']
values = self.env['pos.order'].browse(order_id) values = self.env['pos.order'].browse(order_id)
lines = []
if values.orderline_washing_type and False not in values.lines.mapped('washing_type_id.name'):
values.write({ values.write({
'laundry_order': True, 'laundry_order': True,
}) })
if values.laundry_order:
values.action_pos_order_invoice() values.action_pos_order_invoice()
lines = []
for rec in values.lines: for rec in values.lines:
vals = (0, 0, { vals = (0, 0, {
'product_id': rec.product_id.id, 'product_id': rec.product_id.id,

25
laundry_management_pos/static/src/js/screen/payment_screen.js

@ -0,0 +1,25 @@
/** @odoo-module **/
import PaymentScreen from 'point_of_sale.PaymentScreen';
import Registries from 'point_of_sale.Registries';
export const PosLoyaltyPaymentScreen = (PaymentScreen) =>
class extends PaymentScreen {
//@override
async validateOrder(isForceValidate) {
const order = this.currentOrder;
const hasWashingType = order.get_orderlines().some(line => line.washingType);
if (hasWashingType && !order.get_partner()) {
const { confirmed } = await this.showPopup('ConfirmPopup', {
title: this.env._t('Please select the Customer'),
body: this.env._t(
'You need to select the customer for the order contains laundry products.'
),
});
if (confirmed) {
this.selectPartner();
}
return false
}
await super.validateOrder(...arguments);
}
};
Registries.Component.extend(PaymentScreen, PosLoyaltyPaymentScreen);

43
laundry_management_pos/static/src/js/screen/product_screen.js

@ -1,43 +0,0 @@
/** @odoo-module **/
import ProductScreen from 'point_of_sale.ProductScreen';
import Registries from 'point_of_sale.Registries';
export const PoSSaleBeProductScreen = (ProductScreen) =>
class extends ProductScreen {
async onClickPartner() {
// Override to check whether the laundry type already is added
const currentPartner = this.currentOrder.get_partner();
if (currentPartner && this.currentOrder.getHasRefundLines()) {
this.showPopup('ErrorPopup', {
title: this.env._t("Can't change customer"),
body: _.str.sprintf(
this.env._t(
"This order already has refund lines for %s. We can't change the customer associated to it. Create a new order for the new customer."
),
currentPartner.name
),
});
return;
}
const { confirmed, payload: newPartner } = await this.showTempScreen(
'PartnerListScreen',
{ partner: currentPartner }
);
if (confirmed) {
this.currentOrder.set_partner(newPartner);
var washing=0
for (let line of this.currentOrder.orderlines) {
if (line.get_washingType())
{
washing=1
}
}
if (washing==0)
{
this.currentOrder.updatePricelist(newPartner);
}
}
}
};
Registries.Component.extend(ProductScreen, PoSSaleBeProductScreen);

7
laundry_management_pos/static/src/xml/pos_receipt.xml

@ -19,11 +19,12 @@
</t> </t>
</xpath> </xpath>
</t> </t>
<!-- Inheirited the Order Receipt for dding laundry details--> <!-- Inheirited the Order Receipt for adding laundry details-->
<t t-name="OrderReceipt" t-inherit="point_of_sale.OrderReceipt" <t t-name="OrderReceipt" t-inherit="point_of_sale.OrderReceipt"
t-inherit-mode="extension" owl="1"> t-inherit-mode="extension" owl="1">
<xpath expr="//t[@t-if='receipt.company.logo']" position="replace"/> <xpath expr="//t[@t-if='receipt.company.logo']" position="replace"/>
<xpath expr="//t[@t-if='receipt.company.contact_address']" position="replace"/> <xpath expr="//t[@t-if='receipt.company.contact_address']"
position="replace"/>
<xpath expr="//t[@t-if='receipt.company.phone']" position="replace"/> <xpath expr="//t[@t-if='receipt.company.phone']" position="replace"/>
<xpath expr="//t[@t-if='receipt.company.vat']" position="replace"/> <xpath expr="//t[@t-if='receipt.company.vat']" position="replace"/>
<xpath expr="//t[@t-if='receipt.company.email']" position="replace"> <xpath expr="//t[@t-if='receipt.company.email']" position="replace">
@ -43,12 +44,14 @@
<xpath expr="//div[hasclass('orderlines')]" position="before"> <xpath expr="//div[hasclass('orderlines')]" position="before">
<div> <div>
<div> <div>
<t t-if="receipt.partner">
<t t-esc="receipt.partner.name"/> <t t-esc="receipt.partner.name"/>
<br/> <br/>
<t t-esc="receipt.partner.street"/> <t t-esc="receipt.partner.street"/>
<br/> <br/>
<t t-esc="receipt.partner.address"/> <t t-esc="receipt.partner.address"/>
<br/> <br/>
</t>
</div> </div>
</div> </div>
<br/> <br/>

Loading…
Cancel
Save