16 changed files with 186 additions and 90 deletions
@ -0,0 +1,23 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################### |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Prathyunnan R (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################### |
||||
|
from . import pos_config |
||||
|
from . import res_config_settings |
@ -0,0 +1,39 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################### |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Subina (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################### |
||||
|
from odoo import fields, models |
||||
|
|
||||
|
|
||||
|
class PosConfig(models.Model): |
||||
|
""" Class for adding the fields in the pos config""" |
||||
|
_inherit = "pos.config" |
||||
|
|
||||
|
pos_total_items = fields.Boolean(string="Total Items", |
||||
|
help="The boolean field" |
||||
|
" in pos.config respective" |
||||
|
" to the total_items field" |
||||
|
" in res.config.settings") |
||||
|
pos_total_quantity = fields.Boolean(string="Total Quantity", |
||||
|
help="The boolean field" |
||||
|
" in pos.config respective" |
||||
|
" to the total_quantity field" |
||||
|
" in res.config.settings") |
||||
|
|
@ -0,0 +1,44 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################### |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Subina (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################### |
||||
|
from odoo import fields, models |
||||
|
|
||||
|
|
||||
|
class ConfigSettings(models.TransientModel): |
||||
|
"""Class for adding the fields in res.config.settings""" |
||||
|
_inherit = 'res.config.settings' |
||||
|
|
||||
|
total_items = fields.Boolean(string="Enable Total Items", |
||||
|
related="pos_config_id.pos_total_items", |
||||
|
readonly=False, help="Enable this option " |
||||
|
"will show the total" |
||||
|
" number of items and" |
||||
|
" total quantities of" |
||||
|
" product in the " |
||||
|
"PoS screen.") |
||||
|
total_quantity = fields.Boolean(string="Enable Total Quantity", |
||||
|
related="pos_config_id.pos_total_quantity", |
||||
|
readonly=False, help="Enable this option " |
||||
|
"will show the total" |
||||
|
" number of items and" |
||||
|
" total quantities of" |
||||
|
" product in the" |
||||
|
" receipt.") |
After Width: | Height: | Size: 1006 KiB |
After Width: | Height: | Size: 109 KiB |
After Width: | Height: | Size: 118 KiB |
After Width: | Height: | Size: 454 KiB |
After Width: | Height: | Size: 89 KiB |
@ -1,32 +0,0 @@ |
|||||
<?xml version="1.0" encoding="UTF-8"?> |
|
||||
<templates id="template" xml:space="preserve"> |
|
||||
<!-- Inherit OrderReceipt to Modify it --> |
|
||||
<t t-name="total_quantity_pos.OrderReceipt" |
|
||||
t-inherit="point_of_sale.OrderReceipt" |
|
||||
t-inherit-mode="extension" owl="1"> |
|
||||
<xpath expr="//div[hasclass('pos-receipt-amount')]" position="before"> |
|
||||
<t t-set="order" t-value="this.env.services.pos.get_order()"/> |
|
||||
<t t-if="this.env.services.pos.config.pos_total_quantity"> |
|
||||
<div class="total_qty" style="margin-left:150px"> |
|
||||
<div class="values" style="font-weight: bold;"> |
|
||||
<span class="badge" style="font-size: 16px;">Total Items: |
|
||||
<t t-esc="order.orderlines.length"/></span> |
|
||||
<br/> |
|
||||
<span class="badge" style="font-size: 16px;">Total Quantity: |
|
||||
<t t-set="total_qty" t-value="0"/> |
|
||||
<t t-foreach="order.orderlines" t-as="line" |
|
||||
t-key="line"> |
|
||||
<t t-esc=""/> |
|
||||
<t t-set="total_qty" |
|
||||
t-value="total_qty + line.quantity"/> |
|
||||
</t> |
|
||||
<t t-esc="total_qty"/> |
|
||||
</span> |
|
||||
<br/> |
|
||||
<br/> |
|
||||
</div> |
|
||||
</div> |
|
||||
</t> |
|
||||
</xpath> |
|
||||
</t> |
|
||||
</templates> |
|
@ -1,33 +0,0 @@ |
|||||
<?xml version="1.0" encoding="UTF-8"?> |
|
||||
<templates id="template" xml:space="preserve"> |
|
||||
<!-- Inherit ProductScreen to Modify it --> |
|
||||
<t t-name="total_quantity_pos.ProductScreen" |
|
||||
t-inherit="point_of_sale.ProductScreen" |
|
||||
t-inherit-mode="extension" owl="1"> |
|
||||
<xpath expr="//div[hasclass('control-buttons')]" position="before"> |
|
||||
<t t-set="order" t-value="this.env.services.pos.get_order()"/> |
|
||||
<t t-if="this.pos.config.pos_total_items"> |
|
||||
<div class="total_qty" style="margin-left:350px"> |
|
||||
<div class="values" style="font-weight: bold;"> |
|
||||
<span class="badge" style="font-size: 16px;">Total Items: |
|
||||
<t t-esc="order.orderlines.length"/></span> |
|
||||
<br/> |
|
||||
<span class="badge" style="font-size: 16px;">Total Quantity: |
|
||||
<t t-set="total_qty" t-value="0"/> |
|
||||
<t t-foreach="order.orderlines" t-as="line" |
|
||||
t-key="line"> |
|
||||
<t t-esc=""/> |
|
||||
<t t-set="total_qty" |
|
||||
t-value="total_qty + line.quantity"/> |
|
||||
</t> |
|
||||
<t t-esc="total_qty"/> |
|
||||
<t t-log="total_qty,'total_qty'"/> |
|
||||
</span> |
|
||||
<br/> |
|
||||
<br/> |
|
||||
</div> |
|
||||
</div> |
|
||||
</t> |
|
||||
</xpath> |
|
||||
</t> |
|
||||
</templates> |
|
@ -0,0 +1,43 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<odoo> |
||||
|
<!-- Views adding in the Configuration view of PoS settings --> |
||||
|
<record id="res_config_settings_inheit_view" model="ir.ui.view"> |
||||
|
<field name="name">res.config.settings.inherit.view</field> |
||||
|
<field name="model">res.config.settings</field> |
||||
|
<field name="inherit_id" |
||||
|
ref="point_of_sale.res_config_settings_view_form"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<xpath expr="//block[@id='pos_interface_section']" position="after"> |
||||
|
<div class="row mt16 o_settings_container"> |
||||
|
<div class="col-12 col-lg-6 o_setting_box"> |
||||
|
<div class="o_setting_left_pane"> |
||||
|
<field name="total_items"/> |
||||
|
</div> |
||||
|
<div class="o_setting_right_pane"> |
||||
|
<label for="total_items" string="Enable Total Items"/> |
||||
|
<div class="text-muted"> |
||||
|
Allow to show the total items and quantities in pos screen. |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</xpath> |
||||
|
|
||||
|
<xpath expr="//block[@id='pos_bills_and_receipts_section']" position="inside"> |
||||
|
<div class="row mt16 o_settings_container"> |
||||
|
<div class="col-12 col-lg-6 o_setting_box"> |
||||
|
<div class="o_setting_left_pane"> |
||||
|
<field name="total_quantity"/> |
||||
|
</div> |
||||
|
<div class="o_setting_right_pane"> |
||||
|
<label for="total_quantity" string="Enable Total Items"/> |
||||
|
<div class="text-muted"> |
||||
|
Allow to add the total items and quantities in the bill. |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</xpath> |
||||
|
</field> |
||||
|
</record> |
||||
|
</odoo> |
Loading…
Reference in new issue