Skip to content

Commit

Permalink
[MIG] purchase_order_archive: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mario committed May 10, 2024
1 parent b26098d commit 7761359
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 22 deletions.
3 changes: 3 additions & 0 deletions purchase_order_archive/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ Contributors

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

- Mario Luis <[email protected]>

Maintainers
-----------
Expand Down
2 changes: 1 addition & 1 deletion purchase_order_archive/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"author": "Onestein, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/purchase-workflow",
"category": "Purchases",
"version": "16.0.1.0.0",
"version": "17.0.1.0.0",
"license": "AGPL-3",
"depends": ["purchase"],
"data": ["views/purchase_order.xml"],
Expand Down
2 changes: 2 additions & 0 deletions purchase_order_archive/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
- Andrea Stirpe \<<[email protected]>\>
- Christihan Laurel \<<[email protected]>\>
- [Binhex](https://binhex.cloud/):
- Mario Luis \<<[email protected]>\>
4 changes: 4 additions & 0 deletions purchase_order_archive/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,10 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
<ul class="simple">
<li>Andrea Stirpe &lt;<a class="reference external" href="mailto:a.stirpe&#64;onestein.nl">a.stirpe&#64;onestein.nl</a>&gt;</li>
<li>Christihan Laurel &lt;<a class="reference external" href="mailto:laurel&#64;vauxoo.com">laurel&#64;vauxoo.com</a>&gt;</li>
<li><a class="reference external" href="https://binhex.cloud/">Binhex</a>:<ul>
<li>Mario Luis &lt;<a class="reference external" href="mailto:m.luis&#64;binhex.cloud">m.luis&#64;binhex.cloud</a>&gt;</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand Down
40 changes: 20 additions & 20 deletions purchase_order_archive/tests/test_purchase_order_archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@

from datetime import datetime

from odoo.exceptions import UserError # ValidationError,
from odoo.exceptions import UserError
from odoo.tests.common import TransactionCase


class TestPurchaseOrderArchive(TransactionCase):
def setUp(self):
super().setUp()

self.purchase_order_obj = self.env["purchase.order"]
product_id = self.env.ref("product.product_product_9")
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.purchase_order_obj = cls.env["purchase.order"]
product_id = cls.env.ref("product.product_product_9")
vals = {
"partner_id": self.env.ref("base.res_partner_1").id,
"partner_id": cls.env.ref("base.res_partner_1").id,
"order_line": [
(
0,
Expand All @@ -28,25 +28,25 @@ def setUp(self):
"name": product_id.name,
"product_id": product_id.id,
"product_qty": 1.0,
"product_uom": self.env.ref("uom.product_uom_unit").id,
"product_uom": cls.env.ref("uom.product_uom_unit").id,
"price_unit": 121.0,
"date_planned": datetime.today(),
},
)
],
}
self.po_draft = self.env["purchase.order"].create(vals)
self.po_sent = self.env["purchase.order"].create(vals)
self.po_sent.write({"state": "sent"})
self.po_to_approve = self.env["purchase.order"].create(vals)
self.po_to_approve.write({"state": "to approve"})
self.po_purchase = self.env["purchase.order"].create(vals)
self.po_purchase.button_confirm()
self.po_done = self.env["purchase.order"].create(vals)
self.po_done.button_confirm()
self.po_done.button_done()
self.po_cancel = self.env["purchase.order"].create(vals)
self.po_cancel.button_cancel()
cls.po_draft = cls.env["purchase.order"].create(vals)
cls.po_sent = cls.env["purchase.order"].create(vals)
cls.po_sent.write({"state": "sent"})
cls.po_to_approve = cls.env["purchase.order"].create(vals)
cls.po_to_approve.write({"state": "to approve"})
cls.po_purchase = cls.env["purchase.order"].create(vals)
cls.po_purchase.button_confirm()
cls.po_done = cls.env["purchase.order"].create(vals)
cls.po_done.button_confirm()
cls.po_done.button_done()
cls.po_cancel = cls.env["purchase.order"].create(vals)
cls.po_cancel.button_cancel()

def test_archive(self):
with self.assertRaises(UserError):
Expand Down
2 changes: 1 addition & 1 deletion purchase_order_archive/views/purchase_order.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
name="web_ribbon"
title="Archived"
bg_color="bg-danger"
attrs="{'invisible': [('active', '=', True)]}"
invisible="active"
/>
</xpath>
<xpath expr="//sheet">
Expand Down

0 comments on commit 7761359

Please sign in to comment.