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

[18.0][MIG] pos_product_mergeable_line: Migration to 18.0 #1298

Open
wants to merge 19 commits into
base: 18.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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_product_mergeable_line/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
===============================
Point of Sale - Mergeable Lines
===============================

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

.. |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_product_mergeable_line
: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_product_mergeable_line
: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 extends the Odoo Point of Sale to prevent to merge lines if
product is configured.

By default, new line can be merged with a previous one if the
informations are the same. (same product, same restaurant note, etc...)
and if the UoM Category allow it.

The new module add a boolean field 'Mergeable Line' (default True).

If unchecked, the product will never be merged into another line.

That's important in some context, as in the management of returnable
products, where we want to have a record of all movements.

**Table of contents**

.. contents::
:local:

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

- Go to "Point of Sale > Product" and edit a product
- Uncheck the checkbox "Mergeable line"

|image1|

.. |image1| image:: https://raw.githubusercontent.com/OCA/pos/18.0/pos_product_mergeable_line/static/description/product_form.png

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_product_mergeable_line%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

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

- Sylvain LE GAL <https://twitter.com/legalsylvain>
- `Heliconia Solutions Pvt. Ltd. <https://www.heliconia.io>`__

- Bhavesh Heliconia

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_product_mergeable_line>`_ 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_product_mergeable_line/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
23 changes: 23 additions & 0 deletions pos_product_mergeable_line/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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": "Point of Sale - Mergeable Lines",
"summary": "Allows to configure at the product level,"
" if an order line can be merged or not.",
"version": "18.0.1.0.0",
"category": "Point of Sale",
"author": "GRAP, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/pos",
"license": "AGPL-3",
"maintainers": ["legalsylvain"],
"depends": ["point_of_sale"],
"data": ["views/view_product_template.xml"],
"assets": {
"point_of_sale._assets_pos": [
"pos_product_mergeable_line/static/src/js/models.esm.js",
],
},
"installable": True,
}
43 changes: 43 additions & 0 deletions pos_product_mergeable_line/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * pos_product_mergeable_line
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-06-04 11:34+0000\n"
"Last-Translator: Daniel Duque <[email protected]>\n"
"Language-Team: none\n"
"Language: es\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_product_mergeable_line
#: model:ir.model.fields,help:pos_product_mergeable_line.field_product_product__pos_mergeable_line
#: model:ir.model.fields,help:pos_product_mergeable_line.field_product_template__pos_mergeable_line
msgid ""
"If unchecked, the product will never be merged with a previous line, in the "
"Point of sale."
msgstr ""
"Si está desmarcado, al añadir el producto al carrito del Punto de venta no "
"se fusionará con líneas previas."

#. module: pos_product_mergeable_line
#: model:ir.model.fields,field_description:pos_product_mergeable_line.field_product_product__pos_mergeable_line
#: model:ir.model.fields,field_description:pos_product_mergeable_line.field_product_template__pos_mergeable_line
msgid "Mergeable Line"
msgstr "Unificar líneas de pedido"

#. module: pos_product_mergeable_line
#: model:ir.model,name:pos_product_mergeable_line.model_pos_session
msgid "Point of Sale Session"
msgstr "Sesión TPV"

#. module: pos_product_mergeable_line
#: model:ir.model,name:pos_product_mergeable_line.model_product_template
msgid "Product"
msgstr "Producto"
46 changes: 46 additions & 0 deletions pos_product_mergeable_line/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * pos_product_mergeable_line
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-03-30 15:11+0000\n"
"PO-Revision-Date: 2023-03-30 15:11+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_product_mergeable_line
#: model:ir.model.fields,help:pos_product_mergeable_line.field_product_product__pos_mergeable_line
#: model:ir.model.fields,help:pos_product_mergeable_line.field_product_template__pos_mergeable_line
msgid ""
"If unchecked, the product will never be merged with a previous line, in the "
"Point of sale."
msgstr ""
"Si la case est décochée, l'article ne sera jamais regroupé avec la ligne "
"précédente, dans le point de vente."

#. module: pos_product_mergeable_line
#: model:ir.model.fields,field_description:pos_product_mergeable_line.field_product_product__pos_mergeable_line
#: model:ir.model.fields,field_description:pos_product_mergeable_line.field_product_template__pos_mergeable_line
msgid "Mergeable Line"
msgstr "Ligne regroupable"

#. module: pos_product_mergeable_line
#: model:ir.model,name:pos_product_mergeable_line.model_pos_session
msgid "Point of Sale Session"
msgstr ""

#. module: pos_product_mergeable_line
#: model:ir.model,name:pos_product_mergeable_line.model_product_template
msgid "Product"
msgstr ""

#~ msgid "Product Template"
#~ msgstr "Modèle d'article"
46 changes: 46 additions & 0 deletions pos_product_mergeable_line/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * pos_product_mergeable_line
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-06-04 15:09+0000\n"
"Last-Translator: mymage <[email protected]>\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_product_mergeable_line
#: model:ir.model.fields,help:pos_product_mergeable_line.field_product_product__pos_mergeable_line
#: model:ir.model.fields,help:pos_product_mergeable_line.field_product_template__pos_mergeable_line
msgid ""
"If unchecked, the product will never be merged with a previous line, in the "
"Point of sale."
msgstr ""
"Se non settata, il prodotto non verrà mail unito con una riga precedente nel "
"punto vendita."

#. module: pos_product_mergeable_line
#: model:ir.model.fields,field_description:pos_product_mergeable_line.field_product_product__pos_mergeable_line
#: model:ir.model.fields,field_description:pos_product_mergeable_line.field_product_template__pos_mergeable_line
msgid "Mergeable Line"
msgstr "Riga accoppiabile"

#. module: pos_product_mergeable_line
#: model:ir.model,name:pos_product_mergeable_line.model_pos_session
msgid "Point of Sale Session"
msgstr "Sessione punto vendita"

#. module: pos_product_mergeable_line
#: model:ir.model,name:pos_product_mergeable_line.model_product_template
msgid "Product"
msgstr "Prodotto"

#~ msgid "Product Template"
#~ msgstr "Modello prodotto"
38 changes: 38 additions & 0 deletions pos_product_mergeable_line/i18n/pos_product_mergeable_line.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * pos_product_mergeable_line
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.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_product_mergeable_line
#: model:ir.model.fields,help:pos_product_mergeable_line.field_product_product__pos_mergeable_line
#: model:ir.model.fields,help:pos_product_mergeable_line.field_product_template__pos_mergeable_line
msgid ""
"If unchecked, the product will never be merged with a previous line, in the "
"Point of sale."
msgstr ""

#. module: pos_product_mergeable_line
#: model:ir.model.fields,field_description:pos_product_mergeable_line.field_product_product__pos_mergeable_line
#: model:ir.model.fields,field_description:pos_product_mergeable_line.field_product_template__pos_mergeable_line
msgid "Mergeable Line"
msgstr ""

#. module: pos_product_mergeable_line
#: model:ir.model,name:pos_product_mergeable_line.model_pos_session
msgid "Point of Sale Session"
msgstr ""

#. module: pos_product_mergeable_line
#: model:ir.model,name:pos_product_mergeable_line.model_product_template
msgid "Product"
msgstr ""
1 change: 1 addition & 0 deletions pos_product_mergeable_line/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import product_template
26 changes: 26 additions & 0 deletions pos_product_mergeable_line/models/product_template.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# 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 odoo import api, fields, models


class ProductTemplate(models.Model):
_inherit = "product.template"

pos_mergeable_line = fields.Boolean(
string="Mergeable Line",
default=True,
help="If unchecked, the product will never"
" be merged with a previous line, in the Point of sale.",
)


class ProductProduct(models.Model):
_inherit = "product.product"

@api.model
def _load_pos_data_fields(self, config_id):
result = super()._load_pos_data_fields(config_id)
result.append("pos_mergeable_line")
return result

Check warning on line 26 in pos_product_mergeable_line/models/product_template.py

View check run for this annotation

Codecov / codecov/patch

pos_product_mergeable_line/models/product_template.py#L24-L26

Added lines #L24 - L26 were not covered by tests
3 changes: 3 additions & 0 deletions pos_product_mergeable_line/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
4 changes: 4 additions & 0 deletions pos_product_mergeable_line/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- Go to "Point of Sale \> Product" and edit a product
- Uncheck the checkbox "Mergeable line"

![](../static/description/product_form.png)
3 changes: 3 additions & 0 deletions pos_product_mergeable_line/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Sylvain LE GAL \<<https://twitter.com/legalsylvain>\>
- [Heliconia Solutions Pvt. Ltd.](https://www.heliconia.io)
- Bhavesh Heliconia
13 changes: 13 additions & 0 deletions pos_product_mergeable_line/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
This module extends the Odoo Point of Sale to prevent to merge lines if
product is configured.

By default, new line can be merged with a previous one if the
informations are the same. (same product, same restaurant note, etc...)
and if the UoM Category allow it.

The new module add a boolean field 'Mergeable Line' (default True).

If unchecked, the product will never be merged into another line.

That's important in some context, as in the management of returnable
products, where we want to have a record of all movements.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading