Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[9.0] [ADD] sell loose goods using tare barcode label #447

Merged
merged 27 commits into from Feb 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
355cb8d
Barcode tare.
Fkawala Jan 20, 2020
2a1c8c0
OCA guidelines.
Fkawala Jan 27, 2020
95b60c6
Barcode tare.
Fkawala Jan 20, 2020
776fd95
OCA guidelines.
Fkawala Jan 27, 2020
c5906d3
Merge branch '9.0-tare' of github.com:Fkawala/pos into 9.0-tare
Fkawala Jan 28, 2020
997cb32
Fix doc.
Fkawala Jan 28, 2020
4ae35f4
Fix PEP8.
Fkawala Jan 28, 2020
c237a31
Correct namespace + removed console log.
Fkawala Jan 29, 2020
25ee7f4
Correct model naming.
Fkawala Jan 29, 2020
b43c5d7
Better readme.
Fkawala Jan 29, 2020
c4a4cb2
On single namespace.
Fkawala Jan 29, 2020
8a12de4
Fix missing _t.
Fkawala Jan 29, 2020
51a0a82
Barcode prefix is read from barcode parser.
Fkawala Jan 30, 2020
cd4a460
Fix readme.
Fkawala Jan 30, 2020
5e1edaa
Apply tare according to the product's unit of measure.
Fkawala Feb 3, 2020
ad530c6
Add French translation.
Fkawala Feb 4, 2020
05765a0
use self only when needed.
Fkawala Feb 4, 2020
8cc2940
removed useless fonction parameter.
Fkawala Feb 4, 2020
dc8bb43
Define a "tare" barcode type instead of hijacking the weight type.
Fkawala Feb 5, 2020
c56e1d4
Update i18n files.
Fkawala Feb 5, 2020
f5e33ff
Updated readme.
Fkawala Feb 5, 2020
a52574d
Fix flake8.
Fkawala Feb 5, 2020
f2770c4
Fix XML, refacto, better alert message.
Fkawala Feb 5, 2020
c880ef8
fix translations + better alert message.
Fkawala Feb 6, 2020
6ebf475
This commit adds tare weight to order lines.
Fkawala Feb 12, 2020
bda9a25
Added: demo UOM, better errors, i18n.
Fkawala Feb 14, 2020
d0ca9b9
Fix i18n.
Fkawala Feb 14, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
119 changes: 119 additions & 0 deletions pos_barcode_tare/README.rst
@@ -0,0 +1,119 @@
====================================================
Point of Sale - Tare barecode labels for loose goods
====================================================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! 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/9.0/pos_barcode_tare
:alt: OCA/pos
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/pos-9-0/pos-9-0-pos_barcode_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/9.0
:alt: Try me on Runbot

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

This add-on enables POS to read and print tare barcodes. We print a barcode tare label to sell loose goods in a Bring Your Own pot (BYOC) scheme.

The BYOC scheme has five steps:
1. The cashier weighs the pot and sticks the tare barcode onto the customer's pot.
2. The customer go and put loose goods into the labeled pot.
3. The cashier weighs the pot with loose goods inside. POS computes the price including the pot.
4. The cashier scans the tare barcode. POS get the pot weight from the barcode. POS subtracts the pot weight from the weight of the latest product. POS sets the billable price for the loose goods.
5. The customer pays.

This add-on adds a news screen to POS to print (web) the tare barcode labels. This add-on enables POS to read a tare barcode. Reading a barcode makes POS adjust the weight of the latest article in the order list. The new weight is equal to the total weight minus the tare weight. The price is updated accordingly to the weight change.

POS home screen is now:

.. image:: https://raw.githubusercontent.com/OCA/pos/9.0/pos_barcode_tare/static/description/POS_with_button.png

The label screen is:

.. image:: https://raw.githubusercontent.com/OCA/pos/9.0/pos_barcode_tare/static/description/null_weight.png

When we read a weight the impression button is enabled

.. image:: https://raw.githubusercontent.com/OCA/pos/9.0/pos_barcode_tare/static/description/ready_to_print.png

A barcode label looks like:

.. image:: https://raw.githubusercontent.com/OCA/pos/9.0/pos_barcode_tare/static/description/label.png

Zoom on the action widget:

.. image:: https://raw.githubusercontent.com/OCA/pos/9.0/pos_barcode_tare/static/description/zoom_action_widget.png

**Table of contents**

.. contents::
:local:

Usage
=====

Install this add-on and configure the point of sale where you want to be able to use the tare barecode. The label printing is done using web print. To streamline the label printing it is advised to use the silent printing mode (firefox) or the kiosk printing (chrome).

The command line to start a chrome base browser in kiosk mode with silent printing looks like:

``chromium-browser --use-system-default-printer --kiosk --kiosk-printing http://localhost:8069/``

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

- Merge with Sylvain LE GAL tare module that allows user to set tare on the scale screen.

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_barcode_tare%0Aversion:%209.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
~~~~~~~

* Le Nid

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

- Le Nid
- Sylvain LE GAL
- 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.

This module is part of the `OCA/pos <https://github.com/OCA/pos/tree/9.0/pos_barcode_tare>`_ 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_barcode_tare/__init__.py
@@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
from . import models
24 changes: 24 additions & 0 deletions pos_barcode_tare/__openerp__.py
@@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
# @author: François Kawala
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': "Point of Sale - Tare barecode labels for loose goods",
'version': '9.0.0.0.1',
'category': 'Point of Sale',
'summary': """Point of Sale - Print and scan tare \
barecodes labels to sell loose goods.""",
'author': "Le Nid, Odoo Community Association (OCA)",
'website': "https://github.com/OCA/pos",
'license': 'AGPL-3',
'depends': ['point_of_sale'],
'demo': ['demo/pos_barcode_tare_demo.xml'],
'data': [
'pos_barcode_tare.xml',
'views/pos_config_view.xml',
'data/barcode_rule.xml',
],
'qweb': [
'static/src/xml/pos_barcode_tare.xml',
],
'installable': True,
}
12 changes: 12 additions & 0 deletions pos_barcode_tare/data/barcode_rule.xml
@@ -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>
9 changes: 9 additions & 0 deletions pos_barcode_tare/demo/pos_barcode_tare_demo.xml
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="product_uom_kgm_dbg" model="product.uom">
<field name="category_id" ref="product.product_uom_categ_kgm"/>
<field name="name">Kg</field>
<field name="factor" eval="1"/>
<field name="rounding" eval="0.001"/>
</record>
</odoo>
191 changes: 191 additions & 0 deletions pos_barcode_tare/i18n/fr_CH.po
@@ -0,0 +1,191 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * pos_barcode_tare
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-02-14 06:44+0000\n"
"PO-Revision-Date: 2020-02-14 06:44+0000\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_barcode_tare
#. openerp-web
#: code:addons/addons/pos_barcode_tare/static/src/xml/pos_barcode_tare.xml:8
#: code:addons/pos_barcode_tare/static/src/xml/pos_barcode_tare.xml:8
#, python-format
msgid "Back"
msgstr "Retour"

#. module: pos_barcode_tare
#. openerp-web
#: code:addons/addons/pos_barcode_tare/static/src/js/pos_barcode_tare.js:130
#: code:addons/pos_barcode_tare/static/src/js/pos_barcode_tare.js:130
#, python-format
msgid "Failed to read weight from scale."
msgstr "Echec lors de la lecture du poids depuis la balance"

#. module: pos_barcode_tare
#: model:product.uom,name:pos_barcode_tare.product_uom_kgm_dbg
msgid "Kg"
msgstr "Kg"

#. module: pos_barcode_tare
#: model:ir.ui.view,arch_db:pos_barcode_tare.view_pos_config_form
msgid "Loose good options"
msgstr "Options pour la vente en vrac"

#. module: pos_barcode_tare
#. openerp-web
#: code:addons/addons/pos_barcode_tare/static/src/js/pos_barcode_tare.js:196
#: code:addons/pos_barcode_tare/static/src/js/pos_barcode_tare.js:196
#, python-format
msgid "Maximum tare weight is 99.999kg"
msgstr "Le poids mesuré est supérieur au poids maximum pour la tare: 99.999kg"

#. module: pos_barcode_tare
#. openerp-web
#: code:addons/addons/pos_barcode_tare/static/src/xml/pos_barcode_tare.xml:18
#: code:addons/pos_barcode_tare/static/src/xml/pos_barcode_tare.xml:18
#, python-format
msgid "Print"
msgstr "Imprimer l'étiquette"

#. module: pos_barcode_tare
#. openerp-web
#: code:addons/addons/pos_barcode_tare/static/src/xml/pos_barcode_tare.xml:11
#: code:addons/addons/pos_barcode_tare/static/src/xml/pos_barcode_tare.xml:41
#: code:addons/pos_barcode_tare/static/src/xml/pos_barcode_tare.xml:11
#: code:addons/pos_barcode_tare/static/src/xml/pos_barcode_tare.xml:41
#, python-format
msgid "Print a tare label"
msgstr "Imprimer une étiquette de tare"

#. module: pos_barcode_tare
#: model:ir.model.fields,help:pos_barcode_tare.field_pos_config_iface_tare_label
msgid "Print tare labels with this POS"
msgstr "Utiliser ce POS pour imprimer les étiquettes de tare"

#. module: pos_barcode_tare
#. openerp-web
#: code:addons/addons/pos_barcode_tare/static/src/xml/pos_barcode_tare.xml:15
#: code:addons/pos_barcode_tare/static/src/xml/pos_barcode_tare.xml:15
#, python-format
msgid "Set the pot on the scale and check the weight above"
msgstr "Placez le récipient à tarer sur la balance puis vérifiez le poids ci-dessus"

#. module: pos_barcode_tare
#: model:ir.model.fields,field_description:pos_barcode_tare.field_pos_config_iface_tare_label
msgid "Show tare label button"
msgstr "Utiliser ce POS pour imprimer les étiquettes de tare"

#. module: pos_barcode_tare
#: code:addons/addons/pos_barcode_tare/models/barcode_rule.py:13
#: code:addons/pos_barcode_tare/models/barcode_rule.py:13
#, python-format
msgid "Tare"
msgstr "Tare"

#. module: pos_barcode_tare
#. openerp-web
#: code:addons/addons/pos_barcode_tare/static/src/js/pos_barcode_tare.js:164
#: code:addons/pos_barcode_tare/static/src/js/pos_barcode_tare.js:164
#, python-format
msgid "The scale sent a measure in %s unit. This unit of measure (UOM) in not found in the point of sale. You may need to create a new UOM named %s. The UOM name is case sensitive."
msgstr "La balance à envoyé une mesure en %s. Cette unité de mesure (UOM) n'existe pas. Vous devez probablement créer une UOM nommée %s. Le nom de l'UOM est sensible à la casse."

#. module: pos_barcode_tare
#. openerp-web
#: code:addons/addons/pos_barcode_tare/static/src/js/pos_barcode_tare.js:288
#: code:addons/pos_barcode_tare/static/src/js/pos_barcode_tare.js:288
#, python-format
msgid "The tare (%s) is already set for the product \"%s\". We can not re-apply a tare to this product."
msgstr "La tare (%s) est déjà mesurée pour le produit \"%s\". Nous ne pouvons plus appliquer de tare à ce produit."

#. module: pos_barcode_tare
#. openerp-web
#: code:addons/addons/pos_barcode_tare/static/src/js/pos_barcode_tare.js:319
#: code:addons/pos_barcode_tare/static/src/js/pos_barcode_tare.js:319
#, python-format
msgid "The tare weight is %s %s, it's greater or equal to the product weight %s. We can not apply this tare."
msgstr "Le poids de la tare est de %s %s, c'est plus que le poids du produit %s. Nous ne pouvons pas appliquer cette tare."

#. module: pos_barcode_tare
#. openerp-web
#: code:addons/addons/pos_barcode_tare/static/src/js/pos_barcode_tare.js:74
#: code:addons/pos_barcode_tare/static/src/js/pos_barcode_tare.js:74
#, python-format
msgid "We can not apply this tare barcode."
msgstr "Impossible d'appliquer cette étiquette de tare."

#. module: pos_barcode_tare
#. openerp-web
#: code:addons/addons/pos_barcode_tare/static/src/js/pos_barcode_tare.js:33
#: code:addons/pos_barcode_tare/static/src/js/pos_barcode_tare.js:33
#, python-format
msgid "We can not cast a weight in %s into %s."
msgstr "Nous ne pouvons pas convertir un poids en %s en %s."

#. module: pos_barcode_tare
#: model:product.uom.categ,name:pos_barcode_tare.product_uom_categ_kgm
msgid "Weight"
msgstr "Poids"

#. module: pos_barcode_tare
#. openerp-web
#: code:addons/addons/pos_barcode_tare/static/src/xml/pos_barcode_tare.xml:69
#: code:addons/pos_barcode_tare/static/src/xml/pos_barcode_tare.xml:69
#, python-format
msgid "With a"
msgstr "Avec un(e)"

#. module: pos_barcode_tare
#. openerp-web
#: code:addons/addons/pos_barcode_tare/static/src/xml/pos_barcode_tare.xml:61
#: code:addons/pos_barcode_tare/static/src/xml/pos_barcode_tare.xml:61
#, python-format
msgid "at"
msgstr "à"

#. module: pos_barcode_tare
#: model:ir.model,name:pos_barcode_tare.model_barcode_rule
msgid "barcode.rule"
msgstr "barcode.rule"

#. module: pos_barcode_tare
#. openerp-web
#: code:addons/addons/pos_barcode_tare/static/src/xml/pos_barcode_tare.xml:71
#: code:addons/pos_barcode_tare/static/src/xml/pos_barcode_tare.xml:71
#, python-format
msgid "discount"
msgstr "remise"

#. module: pos_barcode_tare
#. openerp-web
#: code:addons/addons/pos_barcode_tare/static/src/xml/pos_barcode_tare.xml:32
#: code:addons/pos_barcode_tare/static/src/xml/pos_barcode_tare.xml:32
#, python-format
msgid "kg"
msgstr "kg"

#. module: pos_barcode_tare
#: model:ir.model,name:pos_barcode_tare.model_pos_config
msgid "pos.config"
msgstr "pos.config"

#. module: pos_barcode_tare
#. openerp-web
#: code:addons/addons/pos_barcode_tare/static/src/xml/pos_barcode_tare.xml:32
#: code:addons/addons/pos_barcode_tare/static/src/xml/pos_barcode_tare.xml:78
#: code:addons/pos_barcode_tare/static/src/xml/pos_barcode_tare.xml:32
#: code:addons/pos_barcode_tare/static/src/xml/pos_barcode_tare.xml:78
#, python-format
msgid "tare ="
msgstr "tare ="