Skip to content

Commit

Permalink
[ADD] purchase_order_price_recalculation: New addon.
Browse files Browse the repository at this point in the history
TT33369
  • Loading branch information
victoralmau committed May 3, 2022
1 parent baa7afa commit 5e05813
Show file tree
Hide file tree
Showing 17 changed files with 763 additions and 0 deletions.
101 changes: 101 additions & 0 deletions purchase_order_price_recalculation/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
=======================================
Price recalculation in purchases orders
=======================================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! 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%2Fpurchase--workflow-lightgray.png?logo=github
:target: https://github.com/OCA/purchase-workflow/tree/14.0/purchase_order_price_recalculation
: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-14-0/purchase-workflow-14-0-purchase_order_price_recalculation
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/142/14.0
:alt: Try me on Runbot

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

This module adds one button on purchase orders (below the lines) that:

* Recalculates the prices of the order lines that contain a product in them.

It is launched manually as a button to get the user to decide if he/she wants to
recalculate prices when vendor is changed or after duplicating a purchase order
to update or not purchase information.

**Table of contents**

.. contents::
:local:

Usage
=====

#. Go to *Purchase -> Products > Products* and create some record and set differente prices to vendors in Purchase tab, for example: Vendor 1: 10 and Vendor 2: 20.
#. Go to *Purchase -> Orders > Requests for Quotation* and create some record and set Vendor 1.
#. Add a line with the previously created product.
#. The unit price of the product is 10.
#. Change vendor to Vendor 2.
#. Click on the "Update lines info" button.
#. The unit price of the product is 20.

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 smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_order_price_recalculation%0Aversion:%2014.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
~~~~~~~

* Tecnativa

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

* `Tecnativa <https://www.tecnativa.com>`_:

* Víctor Martínez
* Pedro M. Baeza

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-victoralmau| image:: https://github.com/victoralmau.png?size=40px
:target: https://github.com/victoralmau
:alt: victoralmau

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-victoralmau|

This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/14.0/purchase_order_price_recalculation>`_ 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 purchase_order_price_recalculation/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
14 changes: 14 additions & 0 deletions purchase_order_price_recalculation/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2022 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Price recalculation in purchases orders",
"version": "14.0.1.0.0",
"category": "Purchase Management",
"website": "https://github.com/OCA/purchase-workflow",
"author": "Tecnativa, Odoo Community Association (OCA)",
"license": "AGPL-3",
"installable": True,
"depends": ["purchase"],
"data": ["views/purchase_order_view.xml"],
"maintainers": ["victoralmau"],
}
52 changes: 52 additions & 0 deletions purchase_order_price_recalculation/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_order_price_recalculation
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-05-03 08:04+0000\n"
"PO-Revision-Date: 2022-05-03 10:06+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"X-Generator: Poedit 2.3\n"

#. module: purchase_order_price_recalculation
#: model:ir.model.fields,field_description:purchase_order_price_recalculation.field_purchase_order__display_name
msgid "Display Name"
msgstr "Nombre mostrado"

#. module: purchase_order_price_recalculation
#: model:ir.model.fields,field_description:purchase_order_price_recalculation.field_purchase_order__id
msgid "ID"
msgstr "ID"

#. module: purchase_order_price_recalculation
#: model:ir.model.fields,field_description:purchase_order_price_recalculation.field_purchase_order____last_update
msgid "Last Modified on"
msgstr "Última modificación el"

#. module: purchase_order_price_recalculation
#: model:ir.model,name:purchase_order_price_recalculation.model_purchase_order
msgid "Purchase Order"
msgstr "Pedido de compra"

#. module: purchase_order_price_recalculation
#: model_terms:ir.ui.view,arch_db:purchase_order_price_recalculation.purchase_order_form
msgid ""
"This will update all the line prices based on the vendor currently set. Do "
"you want to continue?"
msgstr ""
"Esto actualizará todos los precios de la línea según el proveedor "
"establecido actualmente. ¿Quiere continuar?"

#. module: purchase_order_price_recalculation
#: model_terms:ir.ui.view,arch_db:purchase_order_price_recalculation.purchase_order_form
msgid "Update lines info"
msgstr "Actualizar información de líneas"
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_order_price_recalculation
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-05-03 08:04+0000\n"
"PO-Revision-Date: 2022-05-03 08:04+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: purchase_order_price_recalculation
#: model:ir.model.fields,field_description:purchase_order_price_recalculation.field_purchase_order__display_name
msgid "Display Name"
msgstr ""

#. module: purchase_order_price_recalculation
#: model:ir.model.fields,field_description:purchase_order_price_recalculation.field_purchase_order__id
msgid "ID"
msgstr ""

#. module: purchase_order_price_recalculation
#: model:ir.model.fields,field_description:purchase_order_price_recalculation.field_purchase_order____last_update
msgid "Last Modified on"
msgstr ""

#. module: purchase_order_price_recalculation
#: model:ir.model,name:purchase_order_price_recalculation.model_purchase_order
msgid "Purchase Order"
msgstr ""

#. module: purchase_order_price_recalculation
#: model_terms:ir.ui.view,arch_db:purchase_order_price_recalculation.purchase_order_form
msgid ""
"This will update all the line prices based on the vendor currently set. Do "
"you want to continue?"
msgstr ""

#. module: purchase_order_price_recalculation
#: model_terms:ir.ui.view,arch_db:purchase_order_price_recalculation.purchase_order_form
msgid "Update lines info"
msgstr ""
2 changes: 2 additions & 0 deletions purchase_order_price_recalculation/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from . import purchase_order
13 changes: 13 additions & 0 deletions purchase_order_price_recalculation/models/purchase_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2022 Tecnativa - Víctor Martínez
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo import models


class PurchaseOrder(models.Model):
_inherit = "purchase.order"

def update_lines_info(self):
self.ensure_one()
for line in self.order_line:
line._onchange_quantity()
return True
4 changes: 4 additions & 0 deletions purchase_order_price_recalculation/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* `Tecnativa <https://www.tecnativa.com>`_:

* Víctor Martínez
* Pedro M. Baeza
7 changes: 7 additions & 0 deletions purchase_order_price_recalculation/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
This module adds one button on purchase orders (below the lines) that:

* Recalculates the prices of the order lines that contain a product in them.

It is launched manually as a button to get the user to decide if he/she wants to
recalculate prices when vendor is changed or after duplicating a purchase order
to update or not purchase information.
7 changes: 7 additions & 0 deletions purchase_order_price_recalculation/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#. Go to *Purchase -> Products > Products* and create some record and set differente prices to vendors in Purchase tab, for example: Vendor 1: 10 and Vendor 2: 20.
#. Go to *Purchase -> Orders > Requests for Quotation* and create some record and set Vendor 1.
#. Add a line with the previously created product.
#. The unit price of the product is 10.
#. Change vendor to Vendor 2.
#. Click on the "Update lines info" button.
#. The unit price of the product is 20.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 5e05813

Please sign in to comment.