Skip to content

Commit d4e1090

Browse files
committed
Merge PR #1993 into 16.0
Signed-off-by HviorForgeFlow
2 parents aecbd28 + c65505a commit d4e1090

File tree

20 files changed

+891
-0
lines changed

20 files changed

+891
-0
lines changed

purchase_order_archive/README.rst

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
======================
2+
Purchase Order Archive
3+
======================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:83376fd2375237036fce6945ee04af7f1239599d1453ff39614a8aeb07531a43
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18+
:alt: License: AGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github
20+
:target: https://github.com/OCA/purchase-workflow/tree/16.0/purchase_order_archive
21+
:alt: OCA/purchase-workflow
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/purchase-workflow-16-0/purchase-workflow-16-0-purchase_order_archive
24+
:alt: Translate me on Weblate
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/purchase-workflow&target_branch=16.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
On a system with a high volume of purchases, the number of purchase orders displayed in the list view can become huge.
32+
This module allows to archive Purchase Orders that are in status Locked or Cancelled.
33+
34+
If a purchase order is archived, it will be hidden from the purchase orders list view.
35+
36+
This module only depends on module purchase, but it could be used in combination with OCA module 'record_archiver'
37+
in order to automatically archive old purchase orders.
38+
39+
**Table of contents**
40+
41+
.. contents::
42+
:local:
43+
44+
Usage
45+
=====
46+
47+
To archive purchase orders, you need to:
48+
49+
#. Open the tree view of purchase orders.
50+
#. Select a purchase order (in status Locked or Cancelled) you want to archive.
51+
#. Click on Action > Archive. Confirm.
52+
#. The purchase order is now archived.
53+
54+
To unarchive purchase orders, you need to:
55+
56+
#. Open the tree view of purchase orders.
57+
#. In the filter box select the Archived filter. The list of archived purchase orders will be displayed.
58+
#. Select the purchase order (in status Locked or Cancelled) you want to restore to Active.
59+
#. Click on Action > Unarchive.
60+
#. The purchase order is now active.
61+
62+
Bug Tracker
63+
===========
64+
65+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/purchase-workflow/issues>`_.
66+
In case of trouble, please check there if your issue has already been reported.
67+
If you spotted it first, help us to smash it by providing a detailed and welcomed
68+
`feedback <https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_order_archive%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
69+
70+
Do not contact contributors directly about support or help with technical issues.
71+
72+
Credits
73+
=======
74+
75+
Authors
76+
~~~~~~~
77+
78+
* Onestein
79+
80+
Contributors
81+
~~~~~~~~~~~~
82+
83+
* Andrea Stirpe <[email protected]>
84+
* Christihan Laurel <[email protected]>
85+
86+
Maintainers
87+
~~~~~~~~~~~
88+
89+
This module is maintained by the OCA.
90+
91+
.. image:: https://odoo-community.org/logo.png
92+
:alt: Odoo Community Association
93+
:target: https://odoo-community.org
94+
95+
OCA, or the Odoo Community Association, is a nonprofit organization whose
96+
mission is to support the collaborative development of Odoo features and
97+
promote its widespread use.
98+
99+
This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/16.0/purchase_order_archive>`_ project on GitHub.
100+
101+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

purchase_order_archive/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
2+
3+
from . import models
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright 2017-2020 Onestein (<https://www.onestein.eu>)
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
{
5+
"name": "Purchase Order Archive",
6+
"summary": "Archive Purchase Orders",
7+
"author": "Onestein, Odoo Community Association (OCA)",
8+
"website": "https://github.com/OCA/purchase-workflow",
9+
"category": "Purchases",
10+
"version": "16.0.1.0.0",
11+
"license": "AGPL-3",
12+
"depends": ["purchase"],
13+
"data": ["views/purchase_order.xml"],
14+
"installable": True,
15+
}

purchase_order_archive/i18n/es.po

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * purchase_order_archive
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 14.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"POT-Creation-Date: 2023-08-21 13:51+0000\n"
10+
"PO-Revision-Date: 2023-08-21 15:52+0200\n"
11+
"Last-Translator: \n"
12+
"Language-Team: \n"
13+
"Language: es\n"
14+
"MIME-Version: 1.0\n"
15+
"Content-Type: text/plain; charset=UTF-8\n"
16+
"Content-Transfer-Encoding: 8bit\n"
17+
"Plural-Forms: \n"
18+
"X-Generator: Poedit 3.0.1\n"
19+
20+
#. module: purchase_order_archive
21+
#: model:ir.model.fields,field_description:purchase_order_archive.field_purchase_order__active
22+
#: model_terms:ir.ui.view,arch_db:purchase_order_archive.purchase_order_view_search
23+
#: model_terms:ir.ui.view,arch_db:purchase_order_archive.view_purchase_order_archive_filter
24+
msgid "Active"
25+
msgstr "Activo"
26+
27+
#. module: purchase_order_archive
28+
#: model_terms:ir.ui.view,arch_db:purchase_order_archive.purchase_order_archive_form
29+
#: model_terms:ir.ui.view,arch_db:purchase_order_archive.purchase_order_view_search
30+
#: model_terms:ir.ui.view,arch_db:purchase_order_archive.view_purchase_order_archive_filter
31+
msgid "Archived"
32+
msgstr "Archivado"
33+
34+
#. module: purchase_order_archive
35+
#: model:ir.model.fields,field_description:purchase_order_archive.field_purchase_order__display_name
36+
msgid "Display Name"
37+
msgstr "Nombre mostrado"
38+
39+
#. module: purchase_order_archive
40+
#: model:ir.model.fields,field_description:purchase_order_archive.field_purchase_order__id
41+
msgid "ID"
42+
msgstr "ID"
43+
44+
#. module: purchase_order_archive
45+
#: model:ir.model.fields,field_description:purchase_order_archive.field_purchase_order____last_update
46+
msgid "Last Modified on"
47+
msgstr "Última modificación el"
48+
49+
#. module: purchase_order_archive
50+
#: code:addons/purchase_order_archive/models/purchase_order.py:0
51+
#, python-format
52+
msgid "Only 'Locked' or 'Canceled' orders can be archived"
53+
msgstr "Solo se pueden archivar los pedidos 'Bloqueados' o 'Cancelados'"
54+
55+
#. module: purchase_order_archive
56+
#: model:ir.model,name:purchase_order_archive.model_purchase_order
57+
msgid "Purchase Order"
58+
msgstr "Pedido de compra"
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * purchase_order_archive
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 14.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"Last-Translator: \n"
10+
"Language-Team: \n"
11+
"MIME-Version: 1.0\n"
12+
"Content-Type: text/plain; charset=UTF-8\n"
13+
"Content-Transfer-Encoding: \n"
14+
"Plural-Forms: \n"
15+
16+
#. module: purchase_order_archive
17+
#: model:ir.model.fields,field_description:purchase_order_archive.field_purchase_order__active
18+
#: model_terms:ir.ui.view,arch_db:purchase_order_archive.purchase_order_view_search
19+
#: model_terms:ir.ui.view,arch_db:purchase_order_archive.view_purchase_order_archive_filter
20+
msgid "Active"
21+
msgstr ""
22+
23+
#. module: purchase_order_archive
24+
#: model_terms:ir.ui.view,arch_db:purchase_order_archive.purchase_order_archive_form
25+
#: model_terms:ir.ui.view,arch_db:purchase_order_archive.purchase_order_view_search
26+
#: model_terms:ir.ui.view,arch_db:purchase_order_archive.view_purchase_order_archive_filter
27+
msgid "Archived"
28+
msgstr ""
29+
30+
#. module: purchase_order_archive
31+
#: model:ir.model.fields,field_description:purchase_order_archive.field_purchase_order__display_name
32+
msgid "Display Name"
33+
msgstr ""
34+
35+
#. module: purchase_order_archive
36+
#: model:ir.model.fields,field_description:purchase_order_archive.field_purchase_order__id
37+
msgid "ID"
38+
msgstr ""
39+
40+
#. module: purchase_order_archive
41+
#: model:ir.model.fields,field_description:purchase_order_archive.field_purchase_order____last_update
42+
msgid "Last Modified on"
43+
msgstr ""
44+
45+
#. module: purchase_order_archive
46+
#: code:addons/purchase_order_archive/models/purchase_order.py:0
47+
#, python-format
48+
msgid "Only 'Locked' or 'Canceled' orders can be archived"
49+
msgstr ""
50+
51+
#. module: purchase_order_archive
52+
#: model:ir.model,name:purchase_order_archive.model_purchase_order
53+
msgid "Purchase Order"
54+
msgstr ""

purchase_order_archive/i18n/zh_CN.po

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * purchase_order_archive
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 12.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"PO-Revision-Date: 2020-03-23 13:13+0000\n"
10+
"Last-Translator: Dong <[email protected]>\n"
11+
"Language-Team: none\n"
12+
"Language: zh_CN\n"
13+
"MIME-Version: 1.0\n"
14+
"Content-Type: text/plain; charset=UTF-8\n"
15+
"Content-Transfer-Encoding: \n"
16+
"Plural-Forms: nplurals=1; plural=0;\n"
17+
"X-Generator: Weblate 3.10\n"
18+
19+
#. module: purchase_order_archive
20+
#: model:ir.model.fields,field_description:purchase_order_archive.field_purchase_order__active
21+
#: model_terms:ir.ui.view,arch_db:purchase_order_archive.purchase_order_view_search
22+
#: model_terms:ir.ui.view,arch_db:purchase_order_archive.view_purchase_order_archive_filter
23+
msgid "Active"
24+
msgstr "有效"
25+
26+
#. module: purchase_order_archive
27+
#: model_terms:ir.ui.view,arch_db:purchase_order_archive.purchase_order_archive_form
28+
#: model_terms:ir.ui.view,arch_db:purchase_order_archive.purchase_order_view_search
29+
#: model_terms:ir.ui.view,arch_db:purchase_order_archive.view_purchase_order_archive_filter
30+
msgid "Archived"
31+
msgstr "已归档"
32+
33+
#. module: purchase_order_archive
34+
#: model:ir.model.fields,field_description:purchase_order_archive.field_purchase_order__display_name
35+
msgid "Display Name"
36+
msgstr ""
37+
38+
#. module: purchase_order_archive
39+
#: model:ir.model.fields,field_description:purchase_order_archive.field_purchase_order__id
40+
msgid "ID"
41+
msgstr ""
42+
43+
#. module: purchase_order_archive
44+
#: model:ir.model.fields,field_description:purchase_order_archive.field_purchase_order____last_update
45+
msgid "Last Modified on"
46+
msgstr ""
47+
48+
#. module: purchase_order_archive
49+
#: code:addons/purchase_order_archive/models/purchase_order.py:0
50+
#, python-format
51+
msgid "Only 'Locked' or 'Canceled' orders can be archived"
52+
msgstr "只允许“已锁定”或“已取消”的订单归档"
53+
54+
#. module: purchase_order_archive
55+
#: model:ir.model,name:purchase_order_archive.model_purchase_order
56+
msgid "Purchase Order"
57+
msgstr "采购订单"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
2+
3+
from . import purchase_order
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright 2017-2020 Onestein (<https://www.onestein.eu>)
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
from odoo import _, fields, models
5+
from odoo.exceptions import UserError
6+
7+
8+
class PurchaseOrder(models.Model):
9+
_inherit = "purchase.order"
10+
11+
active = fields.Boolean(default=True)
12+
13+
def toggle_active(self):
14+
if self.filtered(lambda po: po.state not in ["done", "cancel"] and po.active):
15+
raise UserError(_("Only 'Locked' or 'Canceled' orders can be archived"))
16+
return super().toggle_active()
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* Andrea Stirpe <[email protected]>
2+
* Christihan Laurel <[email protected]>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
On a system with a high volume of purchases, the number of purchase orders displayed in the list view can become huge.
2+
This module allows to archive Purchase Orders that are in status Locked or Cancelled.
3+
4+
If a purchase order is archived, it will be hidden from the purchase orders list view.
5+
6+
This module only depends on module purchase, but it could be used in combination with OCA module 'record_archiver'
7+
in order to automatically archive old purchase orders.

0 commit comments

Comments
 (0)