Skip to content
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
112 changes: 112 additions & 0 deletions purchase_order_price_recalculation/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
=======================================
Price recalculation in purchases orders
=======================================

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

.. |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/18.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-18-0/purchase-workflow-18-0-purchase_order_price_recalculation
: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=18.0
:alt: Try me on Runboat

|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
=====

1. 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.
2. Go to *Purchase -> Orders > Requests for Quotation* and create some
record and set Vendor 1.
3. Add a line with the previously created product.
4. The unit price of the product is 10.
5. Change vendor to Vendor 2.
6. Click on the "Update lines info" button.
7. 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 to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_order_price_recalculation%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
-------

* Tecnativa

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

- `Tecnativa <https://www.tecnativa.com>`__:

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

- `Komit <https://komit-consulting.com>`__:

- Cai Hoang Huynh

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/18.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": "18.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"],
}
46 changes: 46 additions & 0 deletions purchase_order_price_recalculation/i18n/es.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:
# * 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,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"

#~ msgid "Display Name"
#~ msgstr "Nombre mostrado"

#~ msgid "ID"
#~ msgstr "ID"

#~ msgid "Last Modified on"
#~ msgstr "Última modificación el"
45 changes: 45 additions & 0 deletions purchase_order_price_recalculation/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# 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"
"PO-Revision-Date: 2023-03-23 13:24+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\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.14.1\n"

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

#. 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 ""
"Questo aggiornerà i prezzi di tutte le righe sulla base del fornitore "
"impostato in questo momento. Vuoi continuare?"

#. module: purchase_order_price_recalculation
#: model_terms:ir.ui.view,arch_db:purchase_order_price_recalculation.purchase_order_form
msgid "Update lines info"
msgstr "Aggiorna info righe"

#~ msgid "Display Name"
#~ msgstr "Nome visualizzato"

#~ msgid "ID"
#~ msgstr "ID"

#~ msgid "Last Modified on"
#~ msgstr "Ultima modifica il"
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_order_price_recalculation
#
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: 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-2024 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._compute_price_unit_and_date_planned_and_name()
return True
3 changes: 3 additions & 0 deletions purchase_order_price_recalculation/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
5 changes: 5 additions & 0 deletions purchase_order_price_recalculation/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- [Tecnativa](https://www.tecnativa.com):
- Víctor Martínez
- Pedro M. Baeza
- [Komit](https://komit-consulting.com):
- Cai Hoang Huynh
8 changes: 8 additions & 0 deletions purchase_order_price_recalculation/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
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.
10 changes: 10 additions & 0 deletions purchase_order_price_recalculation/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
1. 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.
2. Go to *Purchase -\> Orders \> Requests for Quotation* and create
some record and set Vendor 1.
3. Add a line with the previously created product.
4. The unit price of the product is 10.
5. Change vendor to Vendor 2.
6. Click on the "Update lines info" button.
7. 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