Skip to content

Commit

Permalink
[MIG] purchase_quick: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
legalsylvain committed Sep 24, 2024
1 parent 61f1414 commit 2473f33
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 91 deletions.
18 changes: 9 additions & 9 deletions purchase_quick/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ Quick Purchase order
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github
:target: https://github.com/OCA/purchase-workflow/tree/15.0/purchase_quick
:target: https://github.com/OCA/purchase-workflow/tree/16.0/purchase_quick
:alt: OCA/purchase-workflow
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/purchase-workflow-15-0/purchase-workflow-15-0-purchase_quick
:target: https://translation.odoo-community.org/projects/purchase-workflow-16-0/purchase-workflow-16-0-purchase_quick
: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/purchase-workflow&target_branch=15.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/purchase-workflow&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand All @@ -41,13 +41,13 @@ Usage

Inside a purchase order, you can click on "Add products", to open a product tree view, then update "qty to purchase" field.

.. image:: https://raw.githubusercontent.com/OCA/purchase-workflow/15.0/purchase_quick/static/description/01_purchase_order_create.png
.. image:: https://raw.githubusercontent.com/OCA/purchase-workflow/16.0/purchase_quick/static/description/01_purchase_order_create.png
:width: 800 px
:alt: Purchase order create

|
.. image:: https://raw.githubusercontent.com/OCA/purchase-workflow/15.0/purchase_quick/static/description/02_purchase_order_add_product.png
.. image:: https://raw.githubusercontent.com/OCA/purchase-workflow/16.0/purchase_quick/static/description/02_purchase_order_add_product.png
:width: 800 px
:alt: Purchase order Add product

Expand All @@ -57,13 +57,13 @@ The update of "qty to purchase" will add new purchase line or update the existin

|
.. image:: https://raw.githubusercontent.com/OCA/purchase-workflow/15.0/purchase_quick/static/description/03_purchase_order_updated.png
.. image:: https://raw.githubusercontent.com/OCA/purchase-workflow/16.0/purchase_quick/static/description/03_purchase_order_updated.png
:width: 800 px
:alt: Purchase order updated

|
.. image:: https://raw.githubusercontent.com/OCA/purchase-workflow/15.0/purchase_quick/static/description/04_purchase_order_update_product_qty.png
.. image:: https://raw.githubusercontent.com/OCA/purchase-workflow/16.0/purchase_quick/static/description/04_purchase_order_update_product_qty.png
:width: 800 px
:alt: Purchase order update product qty.

Expand All @@ -82,7 +82,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/purchase-workflow/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/purchase-workflow/issues/new?body=module:%20purchase_quick%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_quick%0Aversion:%2016.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.

Expand Down Expand Up @@ -119,6 +119,6 @@ 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/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/15.0/purchase_quick>`_ project on GitHub.
This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/16.0/purchase_quick>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 1 addition & 1 deletion purchase_quick/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

{
"name": "Quick Purchase order",
"version": "15.0.1.0.2",
"version": "16.0.1.0.0",
"author": "Akretion, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/purchase-workflow",
"license": "AGPL-3",
Expand Down
61 changes: 18 additions & 43 deletions purchase_quick/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * quick_purchase
# * purchase_quick
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-01 09:09+0000\n"
"PO-Revision-Date: 2021-11-30 13:56+0000\n"
"Last-Translator: Kévin Roche <[email protected]>\n"
"POT-Creation-Date: 2024-02-09 22:03+0000\n"
"PO-Revision-Date: 2024-02-09 22:03+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: fr\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.3.2\n"
"Plural-Forms: \n"

#. module: purchase_quick
#: model_terms:ir.ui.view,arch_db:purchase_quick.view_purchase_form
Expand All @@ -35,12 +33,14 @@ msgid "For current supplier"
msgstr "Ce Fournisseur"

#. module: purchase_quick
#. odoo-python
#: code:addons/purchase_quick/models/purchase_order.py:0
#, python-format
msgid ""
"Must have only 1 line per product for mass addition, but there are {nr_lines}"
"s lines for the product %(product)s"
msgstr ""
"Must have only 1 line per product for mass addition, but there are "
"%(nr_lines)s lines for the product %(product_name)s"
msgstr "Il doit y avoir seulement une ligne par produit pour l'addition en masse, mais il y a"
" %(nr_lines)s lignes pour le produit %(product_name)s"

#. module: purchase_quick
#: model_terms:ir.ui.view,arch_db:purchase_quick.product_tree_view4purchase
Expand All @@ -54,12 +54,13 @@ msgstr "Ligne de Commande"

#. module: purchase_quick
#: model:ir.model,name:purchase_quick.model_product_product
msgid "Product"
msgstr "Article"
msgid "Product Variant"
msgstr "Variante de produit"

#. module: purchase_quick
#. odoo-python
#: code:addons/purchase_quick/models/purchase_order.py:0
#, fuzzy, python-format
#, python-format
msgid "Product Variants"
msgstr "Articles"

Expand All @@ -71,7 +72,7 @@ msgstr "Bon de commande"
#. module: purchase_quick
#: model:ir.model.fields,field_description:purchase_quick.field_product_product__seller_price
msgid "Seller Price"
msgstr ""
msgstr "Prix fournisseur"

#. module: purchase_quick
#: model:ir.model.fields,help:purchase_quick.field_product_product__po_line_ids
Expand All @@ -81,35 +82,9 @@ msgstr "Technique : utilisé pour calculer les quantités à acheter."
#. module: purchase_quick
#: model_terms:ir.ui.view,arch_db:purchase_quick.product_tree_view4purchase
msgid "UoM"
msgstr ""
msgstr "UdM"

#. module: purchase_quick
#: model:ir.model.fields,field_description:purchase_quick.field_product_product__variant_specific_seller_ids
msgid "Variant Specific Seller"
msgstr ""

#, fuzzy
#~ msgid "Products for purchase"
#~ msgstr "Qté à acheter"

#~ msgid "Add product"
#~ msgstr "Ajouter des articles"

#~ msgid "Filter the product that are in current purchase"
#~ msgstr "Afficher uniquement les articles de la commande d'achat encours"

#~ msgid "In current purchase"
#~ msgstr "Commande encours"

#~ msgid "Po line ids"
#~ msgstr "Ligne d'achats"

#~ msgid "Purchase Products"
#~ msgstr "Articles à acheter"

#~ msgid ""
#~ "Set this quantity to create a new purchase line for this product or "
#~ "update the existing one."
#~ msgstr ""
#~ "Renseigner cette valeur pour créer une nouvelle ligne d'achat ou mettre à "
#~ "jour la ligne dans la commande en cours"
msgstr "Fournisseur spécifique pour cette variante"
14 changes: 9 additions & 5 deletions purchase_quick/i18n/purchase_quick.pot
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_quick
# * purchase_quick
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-02-09 22:06+0000\n"
"PO-Revision-Date: 2024-02-09 22:06+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
Expand All @@ -29,11 +31,12 @@ msgid "For current supplier"
msgstr ""

#. module: purchase_quick
#. odoo-python
#: code:addons/purchase_quick/models/purchase_order.py:0
#, python-format
msgid ""
"Must have only 1 line per product for mass addition, but there are "
"{nr_lines}s lines for the product %(product)s"
"%(nr_lines)s lines for the product %(product_name)s"
msgstr ""

#. module: purchase_quick
Expand All @@ -48,10 +51,11 @@ msgstr ""

#. module: purchase_quick
#: model:ir.model,name:purchase_quick.model_product_product
msgid "Product"
msgid "Product Variant"
msgstr ""

#. module: purchase_quick
#. odoo-python
#: code:addons/purchase_quick/models/purchase_order.py:0
#, python-format
msgid "Product Variants"
Expand Down Expand Up @@ -80,4 +84,4 @@ msgstr ""
#. module: purchase_quick
#: model:ir.model.fields,field_description:purchase_quick.field_product_product__variant_specific_seller_ids
msgid "Variant Specific Seller"
msgstr ""
msgstr ""
8 changes: 4 additions & 4 deletions purchase_quick/models/product_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def _compute_process_qty_purchase(self):

@api.depends("po_line_ids")
def _compute_process_qty(self):
res = super(ProductProduct, self)._compute_process_qty()
res = super()._compute_process_qty()
if self.env.context.get("parent_model", False) == "purchase.order":
self._compute_process_qty_purchase()
return res
Expand All @@ -74,12 +74,12 @@ def search(self, args, offset=0, limit=None, order=None, count=False):
seller = seller.commercial_partner_id or seller
args += [
"|",
("variant_specific_seller_ids.name", "=", seller.id),
("variant_specific_seller_ids.partner_id", "=", seller.id),
"&",
("seller_ids.name", "=", seller.id),
("seller_ids.partner_id", "=", seller.id),
("product_variant_ids", "!=", False),
]
return super(ProductProduct, self).search(
return super().search(
args, offset=offset, limit=limit, order=order, count=count
)

Expand Down
22 changes: 8 additions & 14 deletions purchase_quick/models/purchase_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
# @author Pierrick Brun <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)

from collections import OrderedDict

from odoo import _, models
from odoo.exceptions import ValidationError

Expand Down Expand Up @@ -41,23 +39,19 @@ def _get_quick_line(self, product):
raise ValidationError(
_(
"Must have only 1 line per product for mass addition, but "
"there are {nr_lines}s lines for the product %(product)s"
"there are %(nr_lines)s lines for the product %(product_name)s",
nr_lines=nr_lines,
product_name=product.display_name,
)
% {
"nr_lines": nr_lines,
"product": product.display_name,
}
)
return result

def _get_quick_line_qty_vals(self, product):
return OrderedDict(
{
"product_id": None,
"product_uom": product.quick_uom_id.id,
"product_qty": product.qty_to_process,
}
)
return {
"product_id": None,
"product_uom": product.quick_uom_id.id,
"product_qty": product.qty_to_process,
}

def _complete_quick_line_vals(self, vals, lines_key=""):
# This params are need for playing correctly the onchange
Expand Down
Loading

0 comments on commit 2473f33

Please sign in to comment.