Skip to content

Commit

Permalink
[MIG] purchase_picking_state: Migration to 14.0
Browse files Browse the repository at this point in the history
TT33424
  • Loading branch information
victoralmau committed Mar 11, 2022
1 parent 9b105a3 commit 0ccca75
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 37 deletions.
14 changes: 9 additions & 5 deletions purchase_picking_state/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ Purchase Picking State
: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/12.0/purchase_picking_state
:target: https://github.com/OCA/purchase-workflow/tree/14.0/purchase_picking_state
: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-12-0/purchase-workflow-12-0-purchase_picking_state
:target: https://translation.odoo-community.org/projects/purchase-workflow-14-0/purchase-workflow-14-0-purchase_picking_state
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/142/12.0
:target: https://runbot.odoo-community.org/runbot/142/14.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand All @@ -43,7 +43,7 @@ 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 smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_picking_state%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_picking_state%0Aversion:%2014.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.

Expand All @@ -62,6 +62,10 @@ Contributors
* Carlos Lopez Mite <[email protected]>
* Kevin Khao <[email protected]>

* `Tecnativa <https://www.tecnativa.com>`_:

* Víctor Martínez

Maintainers
~~~~~~~~~~~

Expand All @@ -75,6 +79,6 @@ 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/12.0/purchase_picking_state>`_ project on GitHub.
This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/14.0/purchase_picking_state>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 2 additions & 2 deletions purchase_picking_state/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

{
"name": "Purchase Picking State",
"version": "12.0.1.1.0",
"author": "Akretion, " "Odoo Community Association (OCA)",
"version": "14.0.1.0.0",
"author": "Akretion, Odoo Community Association (OCA)",
"license": "AGPL-3",
"category": "Purchase Management",
"website": "https://github.com/OCA/purchase-workflow",
Expand Down
4 changes: 4 additions & 0 deletions purchase_picking_state/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
* Chafique Delli <[email protected]>
* Carlos Lopez Mite <[email protected]>
* Kevin Khao <[email protected]>

* `Tecnativa <https://www.tecnativa.com>`_:

* Víctor Martínez
12 changes: 8 additions & 4 deletions purchase_picking_state/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils: http://docutils.sourceforge.net/" />
<title>Purchase Picking State</title>
<style type="text/css">

Expand Down Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Purchase Picking State</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/purchase-workflow/tree/12.0/purchase_picking_state"><img alt="OCA/purchase-workflow" src="https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/purchase-workflow-12-0/purchase-workflow-12-0-purchase_picking_state"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/142/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/purchase-workflow/tree/14.0/purchase_picking_state"><img alt="OCA/purchase-workflow" src="https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/purchase-workflow-14-0/purchase-workflow-14-0-purchase_picking_state"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/142/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module adds a “picking status” field on Purchase Orders, displaying the general state of the pickings related to that Order.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
Expand All @@ -391,7 +391,7 @@ <h1><a class="toc-backref" href="#id2">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/purchase-workflow/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_picking_state%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_picking_state%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand All @@ -408,6 +408,10 @@ <h2><a class="toc-backref" href="#id5">Contributors</a></h2>
<li>Chafique Delli &lt;<a class="reference external" href="mailto:chafique.delli&#64;akretion.com">chafique.delli&#64;akretion.com</a>&gt;</li>
<li>Carlos Lopez Mite &lt;<a class="reference external" href="mailto:celm1990&#64;gmail.com">celm1990&#64;gmail.com</a>&gt;</li>
<li>Kevin Khao &lt;<a class="reference external" href="mailto:kevin.khao&#64;akretion.com">kevin.khao&#64;akretion.com</a>&gt;</li>
<li><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:<ul>
<li>Víctor Martínez</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand All @@ -417,7 +421,7 @@ <h2><a class="toc-backref" href="#id6">Maintainers</a></h2>
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/purchase-workflow/tree/12.0/purchase_picking_state">OCA/purchase-workflow</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/purchase-workflow/tree/14.0/purchase_picking_state">OCA/purchase-workflow</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down
10 changes: 5 additions & 5 deletions purchase_picking_state/tests/test_purchase_picking_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT as DTF

from odoo.addons.account.tests.account_test_classes import AccountingTestCase
from odoo.addons.account.tests.common import AccountTestInvoicingCommon


class TestPurchasePickingState(AccountingTestCase):
class TestPurchasePickingState(AccountTestInvoicingCommon):
def setUp(self):
super(TestPurchasePickingState, self).setUp()
super().setUp()
# Useful models
self.PurchaseOrder = self.env["purchase.order"]
self.StockPicking = self.env["stock.picking"]
Expand Down Expand Up @@ -64,9 +64,9 @@ def test_picking_state_in_purchase_order(self):
self.po.button_confirm()
pick = self.po.picking_ids.filtered(lambda x: x.state not in ("done", "cancel"))
pick.move_line_ids.write({"qty_done": 2})
pick.action_done()
pick._action_done()
self.assertEqual(self.po.picking_state, "partially_received")
backorders = self.StockPicking.search([("backorder_id", "=", pick.id)])
backorders.move_line_ids.write({"qty_done": 3})
backorders.action_done()
backorders._action_done()
self.assertEqual(self.po.picking_state, "done")
45 changes: 24 additions & 21 deletions purchase_picking_state/views/purchase_view.xml
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>

<record id="purchase_order_form" model="ir.ui.view">
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_form" />
<field name="arch" type="xml">
<field name="currency_id" position="after">
<field name="picking_state" attrs="{'invisible':[('picking_state','=', 'draft')]}" />
</field>
</field>
</record>

<record id="purchase_order_tree" model="ir.ui.view">
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_tree" />
<field name="arch" type="xml">
<field name="state" position="after">
<field name="picking_state" attrs="{'invisible':[('picking_state','=', 'draft')]}" />
</field>
</field>
</record>

<record id="purchase_order_form" model="ir.ui.view">
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_form" />
<field name="arch" type="xml">
<field name="currency_id" position="after">
<field
name="picking_state"
attrs="{'invisible':[('picking_state','=', 'draft')]}"
/>
</field>
</field>
</record>
<record id="purchase_order_tree" model="ir.ui.view">
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_tree" />
<field name="arch" type="xml">
<field name="state" position="after">
<field
name="picking_state"
attrs="{'invisible':[('picking_state','=', 'draft')]}"
/>
</field>
</field>
</record>
</odoo>

0 comments on commit 0ccca75

Please sign in to comment.