Browse Source
[ADD] : - add support for price with taxes, new option is introduced in the POS config to let the user show price with taxes in product widget.
[ADD] : - add support for price with taxes, new option is introduced in the POS config to let the user show price with taxes in product widget.
- the UI is updated when we change the customer in order to adapt the prices - the computation take in account the pricelist and the fiscal position of the customerpull/39/head
Adil Houmadi
9 years ago
9 changed files with 189 additions and 42 deletions
-
1pos_pricelist/__init__.py
-
4pos_pricelist/__openerp__.py
-
19pos_pricelist/models/__init__.py
-
27pos_pricelist/models/pos_pricelist.py
-
18pos_pricelist/static/src/js/db.js
-
36pos_pricelist/static/src/js/models.js
-
17pos_pricelist/static/src/js/widgets.js
-
30pos_pricelist/static/src/xml/pos.xml
-
15pos_pricelist/views/pos_pricelist_views.xml
@ -0,0 +1,19 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################## |
||||
|
# Point Of Sale - Pricelist for POS Odoo |
||||
|
# Copyright (C) 2015 Taktik (http://www.taktik.be) |
||||
|
# @author Adil Houmadi <ah@taktik.be> |
||||
|
# |
||||
|
# This program is free software: you can redistribute it and/or modify |
||||
|
# it under the terms of the GNU Affero General Public License 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 <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################## |
||||
|
from . import pos_pricelist |
@ -0,0 +1,27 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################## |
||||
|
# Point Of Sale - Pricelist for POS Odoo |
||||
|
# Copyright (C) 2015 Taktik (http://www.taktik.be) |
||||
|
# @author Adil Houmadi <ah@taktik.be> |
||||
|
# |
||||
|
# This program is free software: you can redistribute it and/or modify |
||||
|
# it under the terms of the GNU Affero General Public License 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 <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################## |
||||
|
from openerp import models, fields |
||||
|
|
||||
|
class PosPriceListConfig(models.Model): |
||||
|
_inherit = 'pos.config' |
||||
|
|
||||
|
display_price_with_taxes = fields.Boolean( |
||||
|
string='Price With Taxes', |
||||
|
help="Display Prices with taxes on POS" |
||||
|
) |
@ -0,0 +1,30 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<templates id="template" xml:space="preserve"> |
||||
|
<t t-extend="Product"> |
||||
|
<t t-jquery=".product-img" t-operation="replace"> |
||||
|
<div class="product-img"> |
||||
|
<img t-att-src='image_url' /> |
||||
|
<t t-if="!product.to_weight"> |
||||
|
<span class="price-tag"> |
||||
|
<t t-if="widget.display_price_with_taxes"> |
||||
|
<t t-esc="widget.format_currency(product.price_with_taxes,'Product Price')"/> |
||||
|
</t> |
||||
|
<t t-if="!widget.display_price_with_taxes"> |
||||
|
<t t-esc="widget.format_currency(product.price,'Product Price')"/> |
||||
|
</t> |
||||
|
</span> |
||||
|
</t> |
||||
|
<t t-if="product.to_weight"> |
||||
|
<span class="price-tag"> |
||||
|
<t t-if="widget.display_price_with_taxes"> |
||||
|
<t t-esc="widget.format_currency(product.price_with_taxes,'Product Price')+'/Kg'"/> |
||||
|
</t> |
||||
|
<t t-if="!widget.display_price_with_taxes"> |
||||
|
<t t-esc="widget.format_currency(product.price,'Product Price')+'/Kg'"/> |
||||
|
</t> |
||||
|
</span> |
||||
|
</t> |
||||
|
</div> |
||||
|
</t> |
||||
|
</t> |
||||
|
</templates> |
@ -0,0 +1,15 @@ |
|||||
|
<?xml version="1.0"?> |
||||
|
<openerp> |
||||
|
<data> |
||||
|
<record id="view_pos_config_form_pos_pricelist" model="ir.ui.view"> |
||||
|
<field name="name">view.pos.config.form.pos.pricelist</field> |
||||
|
<field name="model">pos.config</field> |
||||
|
<field name="inherit_id" ref="point_of_sale.view_pos_config_form"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<field name="iface_big_scrollbars" position="after"> |
||||
|
<field name="display_price_with_taxes"/> |
||||
|
</field> |
||||
|
</field> |
||||
|
</record> |
||||
|
</data> |
||||
|
</openerp> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue