@ -1,40 +0,0 @@ |
|||
# -*- coding: utf-8 -*- |
|||
################################################################################ |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Sadique Kottekkat (<https://www.cybrosys.com>) |
|||
# |
|||
# This program is free software: you can modify |
|||
# it under the terms of the GNU Affero General Public License (AGPL) as |
|||
# published by the Free Software Foundation, either version 3 of the |
|||
# License, or (at your option) any later version. |
|||
# |
|||
# 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 for more details. |
|||
# |
|||
# You should have received a copy of the GNU Affero General Public License |
|||
# along with this program. If not, see <https://www.gnu.org/licenses/>. |
|||
# |
|||
################################################################################ |
|||
from odoo import fields, models |
|||
|
|||
|
|||
class ResConfigSettings(models.TransientModel): |
|||
""" |
|||
This is an Odoo model for configuration settings. It inherits from the |
|||
'res.config.settings' model and extends its functionality by adding |
|||
fields for custom receipt design configuration |
|||
""" |
|||
_inherit = 'res.config.settings' |
|||
|
|||
pos_receipt_design = fields.Many2one( |
|||
related='pos_config_id.receipt_design', readonly=False, |
|||
string='Receipt Design', help='Choose any receipt design') |
|||
pos_design_receipt = fields.Text(related='pos_config_id.design_receipt', |
|||
string='Receipt XML') |
|||
pos_is_custom_receipt = fields.Boolean( |
|||
related='pos_config_id.is_custom_receipt', readonly=False, store=True) |
After Width: | Height: | Size: 86 KiB |
Before Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 111 KiB After Width: | Height: | Size: 92 KiB |
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 59 KiB |
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 116 KiB After Width: | Height: | Size: 76 KiB |
Before Width: | Height: | Size: 194 KiB After Width: | Height: | Size: 182 KiB |
Before Width: | Height: | Size: 97 KiB After Width: | Height: | Size: 49 KiB |
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 224 KiB After Width: | Height: | Size: 193 KiB |
@ -0,0 +1,22 @@ |
|||
<?xml version='1.0' encoding='utf-8'?> |
|||
<odoo> |
|||
<!-- Inherits `pos.config` form view to add the new fields for the configuration for custom receipt design --> |
|||
<record id="pos_config_view_form" model="ir.ui.view"> |
|||
<field name="name">pos.config.view.form.inherit.custom.receipts.for.pos</field> |
|||
<field name="model">pos.config</field> |
|||
<field name="inherit_id" ref="point_of_sale.pos_config_view_form"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//setting[@id='other_devices']" position="after"> |
|||
<setting title="Customize the POS receipts" string="Custom Receipt" help="Use custom receipt designs"> |
|||
<field name="is_custom_receipt"/> |
|||
<div class="content-group mt16"> |
|||
<field name="receipt_design" invisible="not is_custom_receipt"/> |
|||
</div> |
|||
<div class="content-group mt16"> |
|||
<field name="design_receipt" invisible="1"/> |
|||
</div> |
|||
</setting> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
</odoo> |
@ -1,34 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<!--Inherit res.config.settings for giving the fields in configuration |
|||
settings--> |
|||
<record id="res_config_settings_view_form" model="ir.ui.view"> |
|||
<field name="name">res.config.settings.view.form.inherit.custom.receipts.for.pos</field> |
|||
<field name="model">res.config.settings</field> |
|||
<field name="priority" eval="95"/> |
|||
<field name="inherit_id" ref="base.res_config_settings_view_form"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//block[@id='pos_bills_and_receipts_section']" position="after"> |
|||
<div class="row mt16 o_settings_container" id="pos_receipts_section"> |
|||
<div class="col-xs-12 col-md-6 o_setting_box"> |
|||
<div class="o_setting_left_pane"> |
|||
<field name="pos_is_custom_receipt"/> |
|||
</div> |
|||
<div class="o_setting_right_pane"> |
|||
<label for="pos_receipt_design"/> |
|||
<div class="text-muted"> |
|||
Use Custom Receipt Design |
|||
</div> |
|||
<div class="content-group mt16"> |
|||
<field name="pos_receipt_design" invisible="not pos_is_custom_receipt" required="pos_is_custom_receipt"/> |
|||
</div> |
|||
<div class="content-group mt16"> |
|||
<field name="pos_design_receipt" invisible="1"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
</odoo> |