Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
152 changes: 152 additions & 0 deletions pos_margin/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
================
PoS Order Margin
================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:226de27158d95b3e6bc61c782653162ef0fbff406529ca1eb4a9660e82ebcf19
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpos-lightgray.png?logo=github
:target: https://github.com/OCA/pos/tree/18.0/pos_margin
:alt: OCA/pos
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/pos-18-0/pos-18-0-pos_margin
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/pos&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module shows margins in PoS frontend during an order creation.

Margins are displayed below the final price of the POS order and under
each pos order line.

|You can see an example image at /static/description/pos_front_end.png|

This module also adds the margin fields to some secondary views. The
margin rate (%) is included in the POS order report, while the margin
amount is displayed in the POS order tree view.

.. |You can see an example image at /static/description/pos_front_end.png| image:: https://raw.githubusercontent.com/OCA/pos/18.0/pos_margin/static/description/pos_front_end.png

**Table of contents**

.. contents::
:local:

Configuration
=============

- If you want to disable the display of the margin, in the front-office
UI, you can uncheck the check box in the res.config.settings shop
form. For that, go to Point of Sale / Configuration / Settings, and
search the "Diplay Margin" field.

|You can see an example image at
/static/description/pos_config_setting.png|

.. |You can see an example image at /static/description/pos_config_setting.png| image:: https://raw.githubusercontent.com/OCA/pos/18.0/pos_margin/static/description/pos_config_setting.png

Known issues / Roadmap
======================

- Since version 16.0, Odoo already calculates the margin of POS orders
and displays it in several views, such as the POS order form view.
However, the UI improvements this module provides on the main POS
screen, available since earlier versions, are still not covered by
core Odoo.

Changelog
=========

16.0.1.0.0
----------

- Migrate to V16.0
- Remove the addition of the margin field to ``pos.order`` and
``pos.order.line`` introduced in v14.0, as this functionality is
already provided by Odoo in v16.0.
- Remove tests.
- Create a ``res.config.settings`` field pos_iface_display_margin to
display margins in PoS frontend.

14.0.1.0.0
----------

- Migrate to V14.0

13.0.1.0.0
----------

- Migrate to V13.0
- Reuse ``sale_margin`` computation to handle multi currency context.
- Correct computation of margin, if a module that adds ``uom_id`` on
``pos.order.line`` is installed.
- Add test

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/pos/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/pos/issues/new?body=module:%20pos_margin%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* GRAP
* FactorLibre

Contributors
------------

- Sylvain LE GAL (https://twitter.com/legalsylvain)
- Wolfgang Pichler
- Murtaza Mithaiwala (https://twitter.com/MurtazaMithaiw4)
- Dhara Solanki <dhara.solanki@initos.com>
- Juan Carlos Bonilla <juancarlos.bonilla@factorlibre.com>
- Antonio Ruban <antoniodavid8@gmail.com>
- Alberto Martínez <alberto.martinez@sygel.es>

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

.. |maintainer-legalsylvain| image:: https://github.com/legalsylvain.png?size=40px
:target: https://github.com/legalsylvain
:alt: legalsylvain

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-legalsylvain|

This module is part of the `OCA/pos <https://github.com/OCA/pos/tree/18.0/pos_margin>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions pos_margin/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from . import report
30 changes: 30 additions & 0 deletions pos_margin/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright (C) 2023 - Today: GRAP (http://www.grap.coop)
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
"name": "PoS Order Margin",
"summary": "Margin on PoS Order",
"version": "18.0.1.0.0",
"category": "Point Of Sale",
"author": "GRAP, FactorLibre, Odoo Community Association (OCA)",
"maintainers": ["legalsylvain"],
"website": "https://github.com/OCA/pos",
"license": "AGPL-3",
"depends": [
"point_of_sale",
],
"data": [
"views/res_config_settings_view.xml",
"views/view_pos_order.xml",
],
"assets": {
"point_of_sale._assets_pos": [
"pos_margin/static/src/js/models.esm.js",
"pos_margin/static/src/js/OrderSummaryMargin.esm.js",
"pos_margin/static/src/xml/pos_margin.xml",
"pos_margin/static/src/css/*.css",
],
},
"installable": True,
}
81 changes: 81 additions & 0 deletions pos_margin/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * pos_margin
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-01-22 22:22+0000\n"
"PO-Revision-Date: 2023-01-22 22:22+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: pos_margin
#: model:ir.model,name:pos_margin.model_res_config_settings
msgid "Config Settings"
msgstr "Opciones de configuración"

#. module: pos_margin
#: model:ir.model.fields,field_description:pos_margin.field_pos_config__iface_display_margin
#: model:ir.model.fields,field_description:pos_margin.field_res_config_settings__pos_iface_display_margin
msgid "Diplay Margin"
msgstr "Mostrar margen"

#. module: pos_margin
#: model:ir.model.fields,help:pos_margin.field_pos_config__iface_display_margin
#: model:ir.model.fields,help:pos_margin.field_res_config_settings__pos_iface_display_margin
#: model_terms:ir.ui.view,arch_db:pos_margin.res_config_settings_view_form_margin_inherit
msgid "Display Margin and Margin Rate in the frontend"
msgstr "Mostrar margen y tasa de margen en el frontend"

#. module: pos_margin
#: model:ir.model.fields,field_description:pos_margin.field_report_pos_order__margin_rate
msgid "Margin Rate (%)"
msgstr "Tasa de Margen (%)"

#. module: pos_margin
#: model_terms:ir.ui.view,arch_db:pos_margin.view_pos_order_tree_inherit
msgid "Margin Total"
msgstr "Margen total"

#. module: pos_margin
#. odoo-javascript
#: code:addons/pos_margin/static/src/xml/pos_margin.xml:0
#, python-format
msgid "Margin:"
msgstr "Margen:"

#. module: pos_margin
#: model:ir.model,name:pos_margin.model_pos_config
msgid "Point of Sale Configuration"
msgstr "Configuración del TPV"

#. module: pos_margin
#: model:ir.model,name:pos_margin.model_report_pos_order
msgid "Point of Sale Orders Report"
msgstr "Informe de Órdenes del Punto de Venta"

#~ msgid "Cost Price"
#~ msgstr "Precio de coste"

#~ msgid ""
#~ "It gives profitability by calculating the difference between the Unit "
#~ "Price and the cost price."
#~ msgstr ""
#~ "Indica el beneficio calculando la diferencia entre el precio unitario y "
#~ "el precio de coste."

#~ msgid "Margin"
#~ msgstr "Margen"

#~ msgid "Point of Sale Order Lines"
#~ msgstr "Líneas de Orden de Punto de Venta"

#~ msgid "Point of Sale Orders"
#~ msgstr "Pedidos del TPV"
62 changes: 62 additions & 0 deletions pos_margin/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * pos_margin
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-08-01 12:09+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: pos_margin
#: model:ir.model,name:pos_margin.model_res_config_settings
msgid "Config Settings"
msgstr "Impostazioni configurazione"

#. module: pos_margin
#: model:ir.model.fields,field_description:pos_margin.field_pos_config__iface_display_margin
#: model:ir.model.fields,field_description:pos_margin.field_res_config_settings__pos_iface_display_margin
msgid "Diplay Margin"
msgstr "Visualizza margine"

#. module: pos_margin
#: model:ir.model.fields,help:pos_margin.field_pos_config__iface_display_margin
#: model:ir.model.fields,help:pos_margin.field_res_config_settings__pos_iface_display_margin
#: model_terms:ir.ui.view,arch_db:pos_margin.res_config_settings_view_form_margin_inherit
msgid "Display Margin and Margin Rate in the frontend"
msgstr "Visualizza margine e aliquota margine sul frontend"

#. module: pos_margin
#: model:ir.model.fields,field_description:pos_margin.field_report_pos_order__margin_rate
msgid "Margin Rate (%)"
msgstr "Aliquota margine (%)"

#. module: pos_margin
#: model_terms:ir.ui.view,arch_db:pos_margin.view_pos_order_tree_inherit
msgid "Margin Total"
msgstr "Totale margine"

#. module: pos_margin
#. odoo-javascript
#: code:addons/pos_margin/static/src/xml/pos_margin.xml:0
#, python-format
msgid "Margin:"
msgstr "Margine:"

#. module: pos_margin
#: model:ir.model,name:pos_margin.model_pos_config
msgid "Point of Sale Configuration"
msgstr "Configurazione punto vendita"

#. module: pos_margin
#: model:ir.model,name:pos_margin.model_report_pos_order
msgid "Point of Sale Orders Report"
msgstr "Resoconto ordini punto vendita"
59 changes: 59 additions & 0 deletions pos_margin/i18n/pos_margin.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * pos_margin
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 17.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: pos_margin
#: model:ir.model,name:pos_margin.model_res_config_settings
msgid "Config Settings"
msgstr ""

#. module: pos_margin
#: model:ir.model.fields,field_description:pos_margin.field_pos_config__iface_display_margin
#: model:ir.model.fields,field_description:pos_margin.field_res_config_settings__pos_iface_display_margin
msgid "Diplay Margin"
msgstr ""

#. module: pos_margin
#: model:ir.model.fields,help:pos_margin.field_pos_config__iface_display_margin
#: model:ir.model.fields,help:pos_margin.field_res_config_settings__pos_iface_display_margin
#: model_terms:ir.ui.view,arch_db:pos_margin.res_config_settings_view_form_margin_inherit
msgid "Display Margin and Margin Rate in the frontend"
msgstr ""

#. module: pos_margin
#: model:ir.model.fields,field_description:pos_margin.field_report_pos_order__margin_rate
msgid "Margin Rate (%)"
msgstr ""

#. module: pos_margin
#: model_terms:ir.ui.view,arch_db:pos_margin.view_pos_order_tree_inherit
msgid "Margin Total"
msgstr ""

#. module: pos_margin
#. odoo-javascript
#: code:addons/pos_margin/static/src/xml/pos_margin.xml:0
#, python-format
msgid "Margin:"
msgstr ""

#. module: pos_margin
#: model:ir.model,name:pos_margin.model_pos_config
msgid "Point of Sale Configuration"
msgstr ""

#. module: pos_margin
#: model:ir.model,name:pos_margin.model_report_pos_order
msgid "Point of Sale Orders Report"
msgstr ""
6 changes: 6 additions & 0 deletions pos_margin/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright (C) 2023 - Today: GRAP (http://www.grap.coop)
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import pos_config
from . import res_config_settings
Loading
Loading