Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
b9e5e48
Barcode tare.
Fkawala Jan 20, 2020
9ae5383
OCA guidelines.
Fkawala Jan 27, 2020
800f792
Fix doc.
Fkawala Jan 28, 2020
9ef8c08
Fix PEP8.
Fkawala Jan 28, 2020
ee6aba1
Correct namespace + removed console log.
Fkawala Jan 29, 2020
f74cfaf
Correct model naming.
Fkawala Jan 29, 2020
1ad4361
Better readme.
Fkawala Jan 29, 2020
5fb08c6
On single namespace.
Fkawala Jan 29, 2020
1aefe54
Fix missing _t.
Fkawala Jan 29, 2020
c911e94
Barcode prefix is read from barcode parser.
Fkawala Jan 30, 2020
c895763
Fix readme.
Fkawala Jan 30, 2020
620cde8
Apply tare according to the product's unit of measure.
Fkawala Feb 3, 2020
ad3168d
Add French translation.
Fkawala Feb 4, 2020
2a68087
use self only when needed.
Fkawala Feb 4, 2020
005472d
removed useless fonction parameter.
Fkawala Feb 4, 2020
d05ce62
Define a "tare" barcode type instead of hijacking the weight type.
Fkawala Feb 5, 2020
874f1fe
Update i18n files.
Fkawala Feb 5, 2020
61e1999
Updated readme.
Fkawala Feb 5, 2020
78e9a30
Fix flake8.
Fkawala Feb 5, 2020
eca7d9c
Fix XML, refacto, better alert message.
Fkawala Feb 5, 2020
93bb69d
fix translations + better alert message.
Fkawala Feb 6, 2020
9693148
This commit adds tare weight to order lines.
Fkawala Feb 12, 2020
df7c68b
Added: demo UOM, better errors, i18n.
Fkawala Feb 14, 2020
521ba37
Fix i18n.
Fkawala Feb 14, 2020
a86d9c6
[UPD] Update pos_barcode_tare.pot
oca-travis Feb 14, 2020
853b74e
Update translation files
oca-transbot Feb 18, 2020
f9c9e5a
Set maintainers for three modules.
Fkawala Feb 18, 2020
9da3822
[UPD] README.rst
OCA-git-bot Feb 18, 2020
6d18713
Migration from v9 to v12
Fkawala May 15, 2020
ada72b0
Better label rendering for web printing.
Fkawala May 15, 2020
2d75e66
Export objects to be used in self weighing addon. Fix tare formatting…
Fkawala May 15, 2020
e251563
[ADD][8.0] pos_tare
legalsylvain Jan 8, 2020
c1d3ff3
[REF] pos_tare: Black python code
legalsylvain Jan 8, 2020
3e88ad3
[MIG] pos_tare: Migration to 12.0
legalsylvain Jan 8, 2020
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
109 changes: 109 additions & 0 deletions pos_tare/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
====================
Point Of Sale - Tare
====================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/12.0/pos_tare
:alt: OCA/pos
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/pos-12-0/pos-12-0-pos_tare
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/184/12.0
:alt: Try me on Runbot

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

Give the possibility to the user to enter a Tare weight, when weighting
products in the Point of Sale.
This will compute automatically net weight and set it to the current
selected order

.. figure:: https://raw.githubusercontent.com/OCA/pos/12.0/pos_tare/static/description/pos_tare.png

The net weight is displayed in the order with the tare value below.

.. figure:: https://raw.githubusercontent.com/OCA/pos/12.0/pos_tare/static/description/order.png

**Table of contents**

.. contents::
:local:

Usage
=====

Install this add-on and configure your point of sale. To enable this addon, go to your point of sale configuration page. There, enable the electronic scale and barcode reader in the "IoT Box" section. In the same page, look up for the "Tare input method" field, and choose a tare method. There are three tare methods:
- "manual", you'll set the tare value when you weight the product;
- "barcode", you'll scan the tare value from a barcode;
- "both", you can both of the above.

To generate a tare barcode you need to use the default barcode nomenclature. The default barcode pattern is `0700000{NNDDD}`. Using that pattern, the barcode for a tare of 0.1kg is `0700000001006`. The `pos_tare_barcode_generator` allows you to create tare labels right from the POS.

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

- Print tare value on customer receipt.

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 smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/pos/issues/new?body=module:%20pos_tare%0Aversion:%2012.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
* Le Nid

Contributors
~~~~~~~~~~~~

- Sylvain LE GAL (https://www.twitter.com/legalsylvain)
- Le Nid
- CoopITEasy


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-fkawala| image:: https://github.com/fkawala.png?size=40px
:target: https://github.com/fkawala
:alt: fkawala

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

|maintainer-fkawala|

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

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions pos_tare/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
25 changes: 25 additions & 0 deletions pos_tare/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# @author: François Kawala
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Point Of Sale - Tare",
"summary": "Manage Tare in Point Of Sale module",
"version": "12.0.1.0.0",
"category": "Point of Sale",
"author": "GRAP, Le Nid, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/pos",
"license": "AGPL-3",
"maintainers": ["fkawala", "legalsylvain"],
"depends": [
"point_of_sale",
],
"data": [
"views/templates.xml",
"views/view_pos_config.xml",
"views/view_pos_order.xml",
"data/barcode_rule.xml",
],
"qweb": [
"static/src/xml/pos_tare.xml",
],
"installable": True,
}
12 changes: 12 additions & 0 deletions pos_tare/data/barcode_rule.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0"?>

<odoo noupdate="1">
<record id="barcode_rule_tare" model="barcode.rule">
<field name="name">Tare</field>
<field name="barcode_nomenclature_id" ref="barcodes.default_barcode_nomenclature"/>
<field name="sequence">81</field>
<field name="type">tare</field>
<field name="encoding">ean13</field>
<field name="pattern">0700000{NNDDD}</field>
</record>
</odoo>
3 changes: 3 additions & 0 deletions pos_tare/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from . import pos_config
from . import pos_order_line
from . import barcode_rule
9 changes: 9 additions & 0 deletions pos_tare/models/barcode_rule.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from odoo import models, fields


class BarcodeRule(models.Model):
_inherit = 'barcode.rule'

type = fields.Selection(selection_add=[
('tare', 'Tare')
])
41 changes: 41 additions & 0 deletions pos_tare/models/pos_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
from odoo import api, models, fields


class PosConfig(models.Model):
_inherit = "pos.config"

iface_tare_method = fields.Selection(
[
("manual", "Input the tare manually"),
("barcode", "Scan a barcode to set the tare"),
("both", "Manual input and barcode"),
],
string="Tare Input Method",
default="both",
required=True,
help="Select tare method:\n"
"* 'manual' : the scale screen has an extra tare input field;\n"
"* 'barecode' : (scan a barcode to tare the selected order line;\n"
"* 'both' : manual input and barcode methods are enabled;",
)

iface_gross_weight_method = fields.Selection(
[
("manual", "Input the Gross Weight manually"),
("scale", "Input Gross Weight via Scale")
],
string="Gross Weight Input Method",
default="scale",
required=True,
)

iface_tare_uom_id = fields.Many2one(
string="Unit of Measure of the tare",
comodel_name="uom.uom",
default=lambda s: s._default_iface_tare_uom_id(),
required=True,
)

@api.model
def _default_iface_tare_uom_id(self):
return self.env.ref("uom.product_uom_kgm")
15 changes: 15 additions & 0 deletions pos_tare/models/pos_order_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright (C) 2020-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 odoo import models, fields
from odoo.addons import decimal_precision as dp


class PosOrderLine(models.Model):
_inherit = "pos.order.line"

tare = fields.Float(
string="Tare",
digits=dp.get_precision("Product Unit of Measure")
)
3 changes: 3 additions & 0 deletions pos_tare/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Sylvain LE GAL (https://www.twitter.com/legalsylvain)
- Le Nid
- CoopITEasy
10 changes: 10 additions & 0 deletions pos_tare/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Give the possibility to the user to enter a Tare weight, when weighting
products in the Point of Sale.
This will compute automatically net weight and set it to the current
selected order

.. figure:: ../static/description/pos_tare.png

The net weight is displayed in the order with the tare value below.

.. figure:: ../static/description/order.png
6 changes: 6 additions & 0 deletions pos_tare/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Install this add-on and configure your point of sale. To enable this addon, go to your point of sale configuration page. There, enable the electronic scale and barcode reader in the "IoT Box" section. In the same page, look up for the "Tare input method" field, and choose a tare method. There are three tare methods:
- "manual", you'll set the tare value when you weight the product;
- "barcode", you'll scan the tare value from a barcode;
- "both", you can both of the above.

To generate a tare barcode you need to use the default barcode nomenclature. The default barcode pattern is `0700000{NNDDD}`. Using that pattern, the barcode for a tare of 0.1kg is `0700000001006`. The `pos_tare_barcode_generator` allows you to create tare labels right from the POS.
Binary file added pos_tare/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading