Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[18.0][MIG] purchase_order_archive: Migration to 18.0 #2495

Merged
merged 33 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
3a60408
[11.0][ADD] purchase_order_archive
astirpe Sep 19, 2018
784a0ba
[UPD] README.rst
OCA-git-bot Oct 31, 2018
a1189cf
[UPD] Update purchase_order_archive.pot
oca-travis Oct 31, 2018
4f6708f
[12.0][MIG] purchase_order_archive
astirpe Dec 3, 2018
2a224b2
[UPD] README.rst
OCA-git-bot Dec 8, 2018
e6294f7
[UPD] Update purchase_order_archive.pot
oca-travis Dec 8, 2018
106be05
[UPD] README.rst
OCA-git-bot Jul 29, 2019
5c068cf
Added translation using Weblate (Chinese (Simplified))
liweijie0812 Sep 2, 2019
cab1f2a
Translated using Weblate (Chinese (Simplified))
liweijie0812 Sep 2, 2019
ead8f37
[13.0][MIG] purchase_order_archive
astirpe Oct 31, 2019
06c6085
[UPD] Update purchase_order_archive.pot
oca-travis Nov 28, 2019
8cfab27
[UPD] README.rst
OCA-git-bot Nov 28, 2019
85127c9
Update translation files
oca-transbot Nov 28, 2019
3392f0e
pre-commit update
OCA-git-bot Mar 14, 2020
af32dcc
Translated using Weblate (Chinese (Simplified))
dong-z Mar 23, 2020
a664333
[14.0][MIG] purchase_order_archive
astirpe Oct 19, 2020
368a4a8
[UPD] Update purchase_order_archive.pot
oca-travis Oct 19, 2020
64b716e
[UPD] README.rst
OCA-git-bot Oct 19, 2020
a0bab27
[IMP] purchase_order_archive: Improve filters (add to all search view…
victoralmau Aug 21, 2023
72503d8
[UPD] Update purchase_order_archive.pot
Aug 21, 2023
dc91d8e
purchase_order_archive 14.0.1.1.0
OCA-git-bot Aug 21, 2023
39aeacc
Update translation files
weblate Sep 2, 2023
cbc3930
[UPD] README.rst
OCA-git-bot Sep 3, 2023
b6df25a
[MIG] purchase_order_archive: Migration to 16.0
CLaurelB Sep 4, 2023
6a522c5
[UPD] Update purchase_order_archive.pot
Sep 16, 2023
a189ed2
Update translation files
weblate Sep 20, 2023
5f41ad4
Added translation using Weblate (Italian)
mymage Dec 24, 2023
1260f29
Translated using Weblate (Italian)
mymage Dec 24, 2023
567067a
[IMP] purchase_order_archive: pre-commit auto fixes
May 6, 2024
c34f49d
[MIG] purchase_order_archive: Migration to 17.0
May 6, 2024
423ee37
[UPD] Update purchase_order_archive.pot
May 15, 2024
dc2c391
[BOT] post-merge updates
OCA-git-bot May 15, 2024
b28324d
[MIG] purchase_order_archive: Migration to 18.0
HeliconiaSolutions Dec 19, 2024
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_archive/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
======================
Purchase Order Archive
======================

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

.. |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_archive
: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_archive
: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|

On a system with a high volume of purchases, the number of purchase
orders displayed in the list view can become huge. This module allows to
archive Purchase Orders that are in status Locked or Cancelled.

If a purchase order is archived, it will be hidden from the purchase
orders list view.

This module only depends on module purchase, but it could be used in
combination with OCA module 'record_archiver' in order to automatically
archive old purchase orders.

**Table of contents**

.. contents::
:local:

Usage
=====

To archive purchase orders, you need to:

1. Open the tree view of purchase orders.
2. Select a purchase order (in status Locked or Cancelled) you want to
archive.
3. Click on Action > Archive. Confirm.
4. The purchase order is now archived.

To unarchive purchase orders, you need to:

1. Open the tree view of purchase orders.
2. In the filter box select the Archived filter. The list of archived
purchase orders will be displayed.
3. Select the purchase order (in status Locked or Cancelled) you want to
restore to Active.
4. Click on Action > Unarchive.
5. The purchase order is now active.

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_archive%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
-------

* Onestein

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

- Andrea Stirpe <[email protected]>
- Christihan Laurel <[email protected]>
- `Binhex <https://binhex.cloud/>`__:

- Mario Luis <[email protected]>

- ``Heliconia Solutions Pvt. Ltd. <https://www.heliconia.io>``\ \_

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/18.0/purchase_order_archive>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions purchase_order_archive/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import models
15 changes: 15 additions & 0 deletions purchase_order_archive/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2017-2020 Onestein (<https://www.onestein.eu>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Purchase Order Archive",
"summary": "Archive Purchase Orders",
"author": "Onestein, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/purchase-workflow",
"category": "Purchases",
"version": "18.0.1.0.0",
"license": "AGPL-3",
"depends": ["purchase"],
"data": ["views/purchase_order.xml"],
"installable": True,
}
50 changes: 50 additions & 0 deletions purchase_order_archive/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_order_archive
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-21 13:51+0000\n"
"PO-Revision-Date: 2023-08-21 15:52+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 3.0.1\n"

#. module: purchase_order_archive
#: model:ir.model.fields,field_description:purchase_order_archive.field_purchase_order__active
msgid "Active"
msgstr "Activo"

#. module: purchase_order_archive
#: model_terms:ir.ui.view,arch_db:purchase_order_archive.purchase_order_archive_form
#: model_terms:ir.ui.view,arch_db:purchase_order_archive.view_purchase_order_archive_filter
msgid "Archived"
msgstr "Archivado"

#. module: purchase_order_archive
#. odoo-python
#: code:addons/purchase_order_archive/models/purchase_order.py:0
#, python-format
msgid "Only 'Locked' or 'Canceled' orders can be archived"
msgstr "Solo se pueden archivar los pedidos 'Bloqueados' o 'Cancelados'"

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

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

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

#~ msgid "Last Modified on"
#~ msgstr "Última modificación el"
40 changes: 40 additions & 0 deletions purchase_order_archive/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_order_archive
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-12-24 12:38+0000\n"
"Last-Translator: mymage <[email protected]>\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.17\n"

#. module: purchase_order_archive
#: model:ir.model.fields,field_description:purchase_order_archive.field_purchase_order__active
msgid "Active"
msgstr "Attivo"

#. module: purchase_order_archive
#: model_terms:ir.ui.view,arch_db:purchase_order_archive.purchase_order_archive_form
#: model_terms:ir.ui.view,arch_db:purchase_order_archive.view_purchase_order_archive_filter
msgid "Archived"
msgstr "In archivio"

#. module: purchase_order_archive
#. odoo-python
#: code:addons/purchase_order_archive/models/purchase_order.py:0
#, python-format
msgid "Only 'Locked' or 'Canceled' orders can be archived"
msgstr "Solo ordini 'Bloccati' o 'Annullati' possono essere archiviati"

#. module: purchase_order_archive
#: model:ir.model,name:purchase_order_archive.model_purchase_order
msgid "Purchase Order"
msgstr "Ordine di acquisto"
37 changes: 37 additions & 0 deletions purchase_order_archive/i18n/purchase_order_archive.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_order_archive
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 17.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_archive
#: model:ir.model.fields,field_description:purchase_order_archive.field_purchase_order__active
msgid "Active"
msgstr ""

#. module: purchase_order_archive
#: model_terms:ir.ui.view,arch_db:purchase_order_archive.purchase_order_archive_form
#: model_terms:ir.ui.view,arch_db:purchase_order_archive.view_purchase_order_archive_filter
msgid "Archived"
msgstr ""

#. module: purchase_order_archive
#. odoo-python
#: code:addons/purchase_order_archive/models/purchase_order.py:0
#, python-format
msgid "Only 'Locked' or 'Canceled' orders can be archived"
msgstr ""

#. module: purchase_order_archive
#: model:ir.model,name:purchase_order_archive.model_purchase_order
msgid "Purchase Order"
msgstr ""
40 changes: 40 additions & 0 deletions purchase_order_archive/i18n/zh_CN.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_order_archive
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2020-03-23 13:13+0000\n"
"Last-Translator: Dong <[email protected]>\n"
"Language-Team: none\n"
"Language: zh_CN\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Weblate 3.10\n"

#. module: purchase_order_archive
#: model:ir.model.fields,field_description:purchase_order_archive.field_purchase_order__active
msgid "Active"
msgstr "有效"

#. module: purchase_order_archive
#: model_terms:ir.ui.view,arch_db:purchase_order_archive.purchase_order_archive_form
#: model_terms:ir.ui.view,arch_db:purchase_order_archive.view_purchase_order_archive_filter
msgid "Archived"
msgstr "已归档"

#. module: purchase_order_archive
#. odoo-python
#: code:addons/purchase_order_archive/models/purchase_order.py:0
#, python-format
msgid "Only 'Locked' or 'Canceled' orders can be archived"
msgstr "只允许“已锁定”或“已取消”的订单归档"

#. module: purchase_order_archive
#: model:ir.model,name:purchase_order_archive.model_purchase_order
msgid "Purchase Order"
msgstr "采购订单"
3 changes: 3 additions & 0 deletions purchase_order_archive/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import purchase_order
27 changes: 27 additions & 0 deletions purchase_order_archive/models/purchase_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2017-2020 Onestein (<https://www.onestein.eu>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import _, api, fields, models
from odoo.exceptions import UserError


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

active = fields.Boolean(default=True)

def toggle_active(self):
if self.filtered(lambda po: po.state not in ["done", "cancel"] and po.active):
raise UserError(_("Only 'Locked' or 'Canceled' orders can be archived"))
return super().toggle_active()

@api.constrains("state")
def _check_state(self):
for rec in self:
if not rec.active:
raise UserError(
_(
"This record is currently archived and cannot have its state "
"modified. Please unarchive the record to make changes. "
)
)
3 changes: 3 additions & 0 deletions purchase_order_archive/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_archive/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- Andrea Stirpe \<<[email protected]>\>
- Christihan Laurel \<<[email protected]>\>
- [Binhex](https://binhex.cloud/):
- Mario Luis \<<[email protected]>\>
- `Heliconia Solutions Pvt. Ltd. <https://www.heliconia.io>`_
10 changes: 10 additions & 0 deletions purchase_order_archive/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
On a system with a high volume of purchases, the number of purchase
orders displayed in the list view can become huge. This module allows to
archive Purchase Orders that are in status Locked or Cancelled.

If a purchase order is archived, it will be hidden from the purchase
orders list view.

This module only depends on module purchase, but it could be used in
combination with OCA module 'record_archiver' in order to automatically
archive old purchase orders.
17 changes: 17 additions & 0 deletions purchase_order_archive/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
To archive purchase orders, you need to:

1. Open the tree view of purchase orders.
2. Select a purchase order (in status Locked or Cancelled) you want to
archive.
3. Click on Action \> Archive. Confirm.
4. The purchase order is now archived.

To unarchive purchase orders, you need to:

1. Open the tree view of purchase orders.
2. In the filter box select the Archived filter. The list of archived
purchase orders will be displayed.
3. Select the purchase order (in status Locked or Cancelled) you want
to restore to Active.
4. Click on Action \> Unarchive.
5. The purchase order is now active.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
../../../../purchase_order_archive
6 changes: 6 additions & 0 deletions purchase_order_archive/setup/purchase_order_archive/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=["setuptools-odoo"],
odoo_addon=True,
)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading