forked from OCA/purchase-workflow
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1640 from OCA/15.0
Syncing from upstream OCA/purchase-workflow (15.0)
- Loading branch information
Showing
37 changed files
with
1,624 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
======================== | ||
Purchase order revisions | ||
======================== | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:09d0b4a539e81ca0e1e2057cd1b33f82803773a0847e5d42429d1a2187041c82 | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |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/15.0/purchase_order_revision | ||
: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_order_revision | ||
: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 | ||
:alt: Try me on Runboat | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
Inspired on OCA module sale_order_revision, this module was rebuilt to implement | ||
purchase_order_revision. | ||
|
||
On Cancelled or RFQ Sent requests for quotation/purchase orders, you can click on New Revision. This | ||
will create a new revision of the RFQ, with the same base number and a | ||
'-revno' suffix appended. A message is added in the chatter saying that a new | ||
revision was created. | ||
|
||
The old revisions of a purchase order are flagged as inactive, so they don't | ||
clutter up searches. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Installation | ||
============ | ||
|
||
Pre-Requirement | ||
|
||
You need to install OCA's base_revision and purchase modules for this module to work. | ||
|
||
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_revision%0Aversion:%2015.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 | ||
~~~~~~~ | ||
|
||
* Open Source Integrators | ||
|
||
Contributors | ||
~~~~~~~~~~~~ | ||
|
||
* Diogo Cordeiro <[email protected]> | ||
* Benedito Monteiro <[email protected]> | ||
* Daniel Reis <[email protected]> | ||
|
||
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/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/15.0/purchase_order_revision>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
from . import models | ||
|
||
|
||
def populate_unrevisioned_name(cr, registry): | ||
cr.execute( | ||
"UPDATE purchase_order " | ||
"SET unrevisioned_name = name " | ||
"WHERE unrevisioned_name is NULL" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
{ | ||
"name": "Purchase order revisions", | ||
"summary": "Keep track of revised quotations", | ||
"version": "15.0.0.0.0", | ||
"category": "Purchase", | ||
"author": "Open Source Integrators," "Odoo Community Association (OCA)", | ||
"website": "https://github.com/OCA/purchase-workflow", | ||
"license": "AGPL-3", | ||
"depends": ["base_revision", "purchase"], | ||
"data": ["view/purchase_order.xml"], | ||
"installable": True, | ||
"post_init_hook": "populate_unrevisioned_name", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * purchase_order_revision | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 15.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_revision | ||
#: model:ir.model.fields,field_description:purchase_order_revision.field_purchase_order__active | ||
msgid "Active" | ||
msgstr "" | ||
|
||
#. module: purchase_order_revision | ||
#: model:ir.model.fields,field_description:purchase_order_revision.field_purchase_order__current_revision_id | ||
msgid "Current revision" | ||
msgstr "" | ||
|
||
#. module: purchase_order_revision | ||
#: model:ir.model.fields,field_description:purchase_order_revision.field_purchase_order__has_old_revisions | ||
msgid "Has Old Revisions" | ||
msgstr "" | ||
|
||
#. module: purchase_order_revision | ||
#: model_terms:ir.ui.view,arch_db:purchase_order_revision.view_purchase_order_form | ||
msgid "New Revision" | ||
msgstr "" | ||
|
||
#. module: purchase_order_revision | ||
#: model:ir.model.fields,field_description:purchase_order_revision.field_purchase_order__old_revision_ids | ||
msgid "Old revisions" | ||
msgstr "" | ||
|
||
#. module: purchase_order_revision | ||
#: model:ir.model.constraint,message:purchase_order_revision.constraint_purchase_order_revision_unique | ||
msgid "Order Reference and revision must be unique per Company." | ||
msgstr "" | ||
|
||
#. module: purchase_order_revision | ||
#: model:ir.model.fields,field_description:purchase_order_revision.field_purchase_order__unrevisioned_name | ||
msgid "Original Reference" | ||
msgstr "" | ||
|
||
#. module: purchase_order_revision | ||
#: model_terms:ir.ui.view,arch_db:purchase_order_revision.view_purchase_order_form | ||
msgid "Prev. revisions" | ||
msgstr "" | ||
|
||
#. module: purchase_order_revision | ||
#: model:ir.model.fields,field_description:purchase_order_revision.field_purchase_order__revision_count | ||
msgid "Previous versions count" | ||
msgstr "" | ||
|
||
#. module: purchase_order_revision | ||
#: model:ir.model,name:purchase_order_revision.model_purchase_order | ||
msgid "Purchase Order" | ||
msgstr "" | ||
|
||
#. module: purchase_order_revision | ||
#: model:ir.model.fields,field_description:purchase_order_revision.field_purchase_order__revision_number | ||
msgid "Revision" | ||
msgstr "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from . import purchase_order |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class PurchaseOrder(models.Model): | ||
_name = "purchase.order" | ||
_inherit = ["purchase.order", "base.revision"] | ||
|
||
current_revision_id = fields.Many2one( | ||
comodel_name="purchase.order", | ||
) | ||
old_revision_ids = fields.One2many( | ||
comodel_name="purchase.order", | ||
) | ||
|
||
# Overwrite as purchase.order can be multi-company | ||
_sql_constraints = [ | ||
( | ||
"revision_unique", | ||
"unique(unrevisioned_name, revision_number, company_id)", | ||
"Order Reference and revision must be unique per Company.", | ||
) | ||
] | ||
|
||
def _prepare_revision_data(self, new_revision): | ||
vals = super()._prepare_revision_data(new_revision) | ||
vals.update({"state": "cancel"}) | ||
return vals | ||
|
||
def action_view_revisions(self): | ||
self.ensure_one() | ||
action = self.env.ref("purchase.purchase_rfq") | ||
result = action.read()[0] | ||
result["domain"] = ["|", ("active", "=", False), ("active", "=", True)] | ||
result["context"] = { | ||
"active_test": 0, | ||
"search_default_current_revision_id": self.id, | ||
"default_current_revision_id": self.id, | ||
} | ||
return result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
* Diogo Cordeiro <[email protected]> | ||
* Benedito Monteiro <[email protected]> | ||
* Daniel Reis <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Inspired on OCA module sale_order_revision, this module was rebuilt to implement | ||
purchase_order_revision. | ||
|
||
On Cancelled or RFQ Sent requests for quotation/purchase orders, you can click on New Revision. This | ||
will create a new revision of the RFQ, with the same base number and a | ||
'-revno' suffix appended. A message is added in the chatter saying that a new | ||
revision was created. | ||
|
||
The old revisions of a purchase order are flagged as inactive, so they don't | ||
clutter up searches. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Pre-Requirement | ||
|
||
You need to install OCA's base_revision and purchase modules for this module to work. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.