Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
e869ed9
[ADD] pos_container: init module
robinkeunen Feb 19, 2019
8fca805
[ADD] pos_container: container model, view and menu
robinkeunen Feb 19, 2019
0f1a3d1
[ADD] pos_container: add container list - broken
robinkeunen Feb 20, 2019
43c6e1e
FIX display container button
Feb 21, 2019
81fb626
ADD new barcode rule type
Feb 21, 2019
8264f2b
ADD dummy container list view
Feb 21, 2019
cbf3cf6
use barcode instead of ean13
Feb 21, 2019
0ffac9e
IMP container list is now fetched and badly displayed
Feb 22, 2019
a6d39dd
add some css
Feb 22, 2019
fccadfb
small fixes
Feb 22, 2019
1d254e3
ADD container creation
Feb 22, 2019
4121657
[IMP] handle container scan then product selection
Feb 27, 2019
6c1651d
[FIX] container creation
Feb 28, 2019
6e485cb
[IMP] now possible to manually select a container
Feb 28, 2019
814947a
ADD readme
Feb 28, 2019
ecf34af
[IMP] pos_container: remove tare from weight
robinkeunen Mar 5, 2019
f52e3b2
[IMP] pos_container: prefix container barcode 049
robinkeunen Mar 5, 2019
f517e1e
[IMP] pos_container: save container name
robinkeunen Mar 5, 2019
56049d1
[IMP] pos_container: container search by name
robinkeunen Mar 5, 2019
43774c8
[IMP] remove useless content
Mar 6, 2019
56e95b8
[IMP] allow container deletion from POS
Mar 6, 2019
d436278
[IMP] add tare manual/auto logic
Mar 7, 2019
265cc7b
[FIX] tabs instead of spaces
Mar 8, 2019
00666b7
[FIX] gross weight
Mar 13, 2019
2d2229b
[IMP] add tare info on PosTicket
Mar 14, 2019
7b7a987
[FIX] container deletion mechanism
Mar 26, 2019
3104217
[FIX] set container only lines qty to 0
Mar 28, 2019
dd348c0
[FIX] Do not show container-only lines on ticket
Mar 28, 2019
da0e5c6
[IMP] add basic testing
Apr 10, 2019
dee19ec
[FIX] container weight in kg
Apr 11, 2019
dc2f75b
[FIX] correctly display XmlReceipt
Apr 11, 2019
9e64dd8
[IMP] correctly display tare/container data when loading past orders
Apr 16, 2019
3c9f0d2
[FIX] price change/discount is also a manual input
Apr 17, 2019
5de627e
[FIX] do not add orderline on container creation
Apr 18, 2019
025f5fc
[IMP] add detailed tour testing
Apr 18, 2019
750ffc0
[FIX] flake8
Apr 23, 2019
e1fdc40
[FIX] set empty orderline qty to 0
Apr 30, 2019
46130e4
[FIX] update gross weight when tare is manually changed
May 3, 2019
31c2c3a
[FIX] display virtual keyboard when needed
May 9, 2019
757a365
[FIX] always trigger change on set_quantity
May 9, 2019
d25e231
[FIX] bad rounding on gross_weight and tare
May 9, 2019
ffb1513
[IMP] allow to use inactivated empty container product
Jun 5, 2019
80ac878
[FIX] technical product is now created inactive
Jul 3, 2019
5e858e1
!fixup technical product is now really created inative
Jul 16, 2019
ffaec5f
[IMP] also hide technical product in PoS
Jul 16, 2019
267ca05
[FIX] missing import
Jul 16, 2019
b2216b2
[FIX] report changes from pos_order_mgmt
Sep 20, 2019
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
81 changes: 81 additions & 0 deletions pos_container/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
=============
POS Container
=============

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! 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/github-OCA%2Fpos-lightgray.png?logo=github
:target: https://github.com/OCA/pos/tree/12.0/pos_container
:alt: OCA/pos
.. |badge3| 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_container
:alt: Translate me on Weblate
.. |badge4| 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|

This module allows to handle use of reusable containers in POS,
this is useful to handle selling product in bulk without having to calculate
the tare of the container.

Each container is identified by a barcode, the weight is stored in Odoo.

**Table of contents**

.. contents::
:local:

Usage
=====

You have to create a Barcode Nomenclature to handle containers before using the
module.

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_container%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
~~~~~~~

* Coop IT Easy SCRLfs

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

* Pierrick Brun <[email protected]>
* Robin Keunen <[email protected]>

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/12.0/pos_container>`_ 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_container/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import models
36 changes: 36 additions & 0 deletions pos_container/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright 2019 Coop IT Easy SCRLfs
# Robin Keunen <[email protected]>
# Pierrick Brun <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).{
{
'name': "POS Container",
'version': '12.0.1.0.0',

'summary': """
Allows managing pre-weighted containers for bulk shop""",

"author": "Coop IT Easy SCRLfs, "
"Odoo Community Association (OCA)",
'license': "AGPL-3",
'website': "https://github.com/OCA/pos/",

'category': 'Point of Sale',

'depends': ['point_of_sale'],

'data': [
'data/product.xml',
'views/container.xml',
'templates/templates.xml',
'security/ir.model.access.csv',
],
'demo': [
'demo/demo.xml',
],

'qweb': [
'static/src/xml/pos.xml',
],

'installable': True,
}
20 changes: 20 additions & 0 deletions pos_container/data/product.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<odoo>
<record id="temporary_container_product" model="product.product">
<field name="name">Container without product</field>
<!-- The barcode is used to find it from the POS -->
<field name="barcode">CONTAINER</field>
<field name="uom_id" ref="uom.product_uom_kgm"/>
<field name="uom_po_id" ref="uom.product_uom_kgm"/>
<field name="purchase_ok" eval="False"/>
<field name="description">
This product is used to describe POS order lines having a container but no product yet
</field>
<field name="list_price">0</field>
<field name="available_in_pos" eval="True"/>
<field name="to_weight" eval="True"/>
<field name="active" eval="False"/>
</record>
<record id="temporary_container_product_product_template" model="product.template">
<field name="active" eval="False"/>
</record>
</odoo>
19 changes: 19 additions & 0 deletions pos_container/demo/demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<odoo>
<record id="container_1" model="pos.container">
<field name="name">Container 1</field>
<field name="barcode">0498765456789</field>
<field name="weight">0.123</field>
</record>

<record id="container_2" model="pos.container">
<field name="name">Container 2</field>
<field name="barcode">0490987654356</field>
<field name="weight">0.234</field>
</record>

<record id="container_3" model="pos.container">
<field name="name">Container 3</field>
<field name="barcode">0490987654398</field>
<field name="weight">0.567</field>
</record>
</odoo>
3 changes: 3 additions & 0 deletions pos_container/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from . import container
from . import barcode
from . import pos_order_line
13 changes: 13 additions & 0 deletions pos_container/models/barcode.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2019 Coop IT Easy SCRLfs
# Pierrick Brun <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo import models, fields


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

type = fields.Selection(
selection_add=[('container', 'Container unit')],
)
41 changes: 41 additions & 0 deletions pos_container/models/container.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright 2019 Coop IT Easy SCRLfs
# Robin Keunen <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo import models, fields, api


class Container(models.Model):
_name = 'pos.container'
_description = 'Container for bulk items'

name = fields.Char(
string='Name',
)
barcode = fields.Char(
'Barcode',
size=13,
)
weight = fields.Float(
string='Weight (kg)',
)
owner_id = fields.Many2one(
comodel_name='res.partner',
inverse_name='container_ids',
string='Owner',
)

_sql_constraints = [
('barcode_uniq',
'unique(barcode)',
"A barcode can only be assigned to one container !"),
]

@api.model
def create_from_ui(self, container):
container_id = container.pop('id', False)
if container_id: # Modifying existing container
self.browse(container_id).write(container)
else:
container_id = self.create(container).id
return container_id
15 changes: 15 additions & 0 deletions pos_container/models/pos_order_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2019 Coop IT Easy SCRLfs
# @author Pierrick Brun <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models


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

tare = fields.Float('Tare')
container_weight = fields.Float('Container Weight')
container_id = fields.Many2one(
'pos.container',
'Container')
2 changes: 2 additions & 0 deletions pos_container/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Pierrick Brun <[email protected]>
* Robin Keunen <[email protected]>
5 changes: 5 additions & 0 deletions pos_container/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This module allows to handle use of reusable containers in POS,
this is useful to handle selling product in bulk without having to calculate
the tare of the container.

Each container is identified by a barcode, the weight is stored in Odoo.
2 changes: 2 additions & 0 deletions pos_container/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
You have to create a Barcode Nomenclature to handle containers before using the
module.
3 changes: 3 additions & 0 deletions pos_container/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_pos_container_pos_user,access_pos_container_pos_user,model_pos_container,point_of_sale.group_pos_user,1,1,1,1
access_pos_container_pos_manager,access_pos_container_pos_manager,model_pos_container,point_of_sale.group_pos_manager,1,1,1,1
Loading