Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 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
8bc3601
[ADD] pos_toledo_product: new module
vvrossem Mar 8, 2019
97f96ad
[REF] removed unused code
vvrossem Mar 11, 2019
76af962
[ADD] pos_container: init module
robinkeunen Feb 19, 2019
f968f6c
[ADD] pos_container: container model, view and menu
robinkeunen Feb 19, 2019
d55d396
[ADD] pos_container: add container list - broken
robinkeunen Feb 20, 2019
72f42a7
FIX display container button
Feb 21, 2019
45c11b5
ADD new barcode rule type
Feb 21, 2019
a6cabcc
ADD dummy container list view
Feb 21, 2019
9d3cc69
use barcode instead of ean13
Feb 21, 2019
0443eee
IMP container list is now fetched and badly displayed
Feb 22, 2019
0aea1c8
add some css
Feb 22, 2019
f395249
small fixes
Feb 22, 2019
33b2edb
ADD container creation
Feb 22, 2019
0e5e9b9
[IMP] handle container scan then product selection
Feb 27, 2019
ccec32f
[FIX] container creation
Feb 28, 2019
49883a5
[IMP] now possible to manually select a container
Feb 28, 2019
8eb182f
ADD readme
Feb 28, 2019
2ed211d
[IMP] pos_container: remove tare from weight
robinkeunen Mar 5, 2019
6dcc053
[IMP] pos_container: prefix container barcode 049
robinkeunen Mar 5, 2019
f401b66
[IMP] pos_container: save container name
robinkeunen Mar 5, 2019
701de98
[IMP] pos_container: container search by name
robinkeunen Mar 5, 2019
9c6feef
[IMP] remove useless content
Mar 6, 2019
bd124fb
[IMP] allow container deletion from POS
Mar 6, 2019
6c0459c
[IMP] add tare manual/auto logic
Mar 7, 2019
b511138
[FIX] tabs instead of spaces
Mar 8, 2019
3e1c51b
[FIX] gross weight
Mar 13, 2019
200f015
[IMP] add tare info on PosTicket
Mar 14, 2019
9dc27b8
Merge remote-tracking branch 'pierrickbrun/pos-container' into pos-co…
robinkeunen Apr 4, 2019
da0e5c6
[IMP] add basic testing
Apr 10, 2019
d8155c6
[ADD] pos_toledo_container: new module
vvrossem Mar 8, 2019
3a18a3a
[REF] removed unused code lines
vvrossem Mar 11, 2019
1a71e61
Merge pull request #5 from vvrossem/12.0-pos_toledo_container
robinkeunen 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
fe70b74
Merge remote-tracking branch 'pierrick/pos-container' into pos-container
robinkeunen Apr 18, 2019
c4e3bb5
[FIX] pos_container: fix xml renderer
robinkeunen Apr 18, 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 <pierrick.brun@akretion.com>
* Robin Keunen <robin.keunen@coopiteasy.be>

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 <robin@coopiteasy.be>
# Pierrick Brun <pierrick.brun@akretion.com>
# 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,
}
16 changes: 16 additions & 0 deletions pos_container/data/product.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<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"/>
</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 <pierrick.brun@akretion.com>
# 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 <robin@coopiteasy.be>
# 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 <pierrick.brun@akretion.com>
# 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 <pierrick.brun@akretion.com>
* Robin Keunen <robin.keunen@coopiteasy.be>
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