Skip to content

Commit

Permalink
[MIG] stock_request_purchase: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bruno-zanotti committed Mar 22, 2024
1 parent 28a8e98 commit 4ed23f6
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 30 deletions.
18 changes: 10 additions & 8 deletions stock_request_purchase/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ Stock Request Purchase
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github
:target: https://github.com/OCA/stock-logistics-warehouse/tree/15.0/stock_request_purchase
:alt: OCA/stock-logistics-warehouse
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fstock--logistics--request-lightgray.png?logo=github
:target: https://github.com/OCA/stock-logistics-request/tree/16.0/stock_request_purchase
:alt: OCA/stock-logistics-request
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-15-0/stock-logistics-warehouse-15-0-stock_request_purchase
:target: https://translation.odoo-community.org/projects/stock-logistics-request-16-0/stock-logistics-request-16-0-stock_request_purchase
: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/stock-logistics-warehouse&target_branch=15.0
:target: https://runboat.odoo-community.org/webui/builds.html?repo=OCA/stock-logistics-request&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand Down Expand Up @@ -52,10 +52,10 @@ Known issues / Roadmap
Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-warehouse/issues>`_.
Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-request/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/stock-logistics-warehouse/issues/new?body=module:%20stock_request_purchase%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/stock-logistics-request/issues/new?body=module:%20stock_request_purchase%0Aversion:%2016.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 @@ -74,6 +74,8 @@ Contributors
* Enric Tobella <etobella@creublanca.es>
* Kitti Upariphutthiphong <kittiu@ecosoft.co.th>
* Alan Ramos <alan.ramos@jarsa.com.mx>
* Urvisha Desai <udesai@opensourceintegrators.com>
* Bruno Zanotti <bz@adhoc.com.ar>

Maintainers
~~~~~~~~~~~
Expand All @@ -88,6 +90,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/stock-logistics-warehouse <https://github.com/OCA/stock-logistics-warehouse/tree/15.0/stock_request_purchase>`_ project on GitHub.
This module is part of the `OCA/stock-logistics-request <https://github.com/OCA/stock-logistics-request/tree/16.0/stock_request_purchase>`_ 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 stock_request_purchase/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
{
"name": "Stock Request Purchase",
"summary": "Internal request for stock",
"version": "15.0.1.2.0",
"version": "16.0.1.0.0",
"license": "LGPL-3",
"website": "https://github.com/OCA/stock-logistics-warehouse",
"website": "https://github.com/OCA/stock-logistics-request",
"author": "ForgeFlow, Odoo Community Association (OCA)",
"category": "Warehouse Management",
"depends": ["stock_request", "purchase_stock"],
Expand Down
2 changes: 2 additions & 0 deletions stock_request_purchase/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
* Enric Tobella <etobella@creublanca.es>
* Kitti Upariphutthiphong <kittiu@ecosoft.co.th>
* Alan Ramos <alan.ramos@jarsa.com.mx>
* Urvisha Desai <udesai@opensourceintegrators.com>
* Bruno Zanotti <bz@adhoc.com.ar>
9 changes: 5 additions & 4 deletions stock_request_purchase/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ <h1 class="title">Stock Request Purchase</h1>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:96f224f25a9395d4d82515ea71d5c95181b021a9ee42510b09dd962f5c0ec13a
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" 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 image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/stock-logistics-warehouse/tree/15.0/stock_request_purchase"><img alt="OCA/stock-logistics-warehouse" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/stock-logistics-warehouse-15-0/stock-logistics-warehouse-15-0-stock_request_purchase"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-warehouse&amp;target_branch=15.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" 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 image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/stock-logistics-request/tree/16.0/stock_request_purchase"><img alt="OCA/stock-logistics-request" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--request-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/stock-logistics-request-16-0/stock-logistics-request-16-0-stock_request_purchase"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/webui/builds.html?repo=OCA/stock-logistics-request&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module allows for users to be able to display purchase orders that have
been created as a consequence of Stock Requests.</p>
<p><strong>Table of contents</strong></p>
Expand Down Expand Up @@ -401,10 +401,10 @@ <h1><a class="toc-backref" href="#toc-entry-2">Known issues / Roadmap</a></h1>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/issues">GitHub Issues</a>.
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/stock-logistics-request/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 to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20stock_request_purchase%0Aversion:%2015.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/stock-logistics-request/issues/new?body=module:%20stock_request_purchase%0Aversion:%2016.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 @@ -422,6 +422,7 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
<li>Enric Tobella &lt;<a class="reference external" href="mailto:etobella&#64;creublanca.es">etobella&#64;creublanca.es</a>&gt;</li>
<li>Kitti Upariphutthiphong &lt;<a class="reference external" href="mailto:kittiu&#64;ecosoft.co.th">kittiu&#64;ecosoft.co.th</a>&gt;</li>
<li>Alan Ramos &lt;<a class="reference external" href="mailto:alan.ramos&#64;jarsa.com.mx">alan.ramos&#64;jarsa.com.mx</a>&gt;</li>
<li>Urvisha Desai &lt;<a class="reference external" href="mailto:udesai&#64;opensourceintegrators.com">udesai&#64;opensourceintegrators.com</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand All @@ -431,7 +432,7 @@ <h2><a class="toc-backref" href="#toc-entry-7">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/stock-logistics-warehouse/tree/15.0/stock_request_purchase">OCA/stock-logistics-warehouse</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/stock-logistics-request/tree/16.0/stock_request_purchase">OCA/stock-logistics-request</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
8 changes: 4 additions & 4 deletions stock_request_purchase/tests/test_stock_request_purchase.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def _create_product(self, default_code, name, company_id):
"company_id": company_id,
"type": "product",
"route_ids": [(6, 0, self.route_buy.ids)],
"seller_ids": [(0, 0, {"name": self.supplier.id, "delay": 5})],
"seller_ids": [(0, 0, {"partner_id": self.supplier.id, "delay": 5})],
}
)

Expand Down Expand Up @@ -117,7 +117,7 @@ def test_create_request_01(self):
self.assertEqual(order.state, "open")
self.assertEqual(order.stock_request_ids.state, "open")

order.refresh()
order.invalidate_recordset()
self.assertEqual(len(order.sudo().purchase_ids), 1)
self.assertEqual(len(order.picking_ids), 0)
self.assertEqual(len(order.move_ids), 0)
Expand Down Expand Up @@ -176,8 +176,8 @@ def test_create_request_02(self):
sum(stock_request_2.sudo().purchase_line_ids.mapped("product_qty")), 10
)

stock_request_1.refresh()
stock_request_2.refresh()
stock_request_1.invalidate_recordset()
stock_request_2.invalidate_recordset()

self.assertEqual(len(stock_request_1.sudo().purchase_ids), 1)
self.assertEqual(len(stock_request_2.sudo().purchase_ids), 1)
Expand Down
20 changes: 10 additions & 10 deletions stock_request_purchase/views/purchase_order_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
<field name="name">purchase.order.form</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_form" />
<field
name="groups_id"
eval="[(4, ref('stock_request.group_stock_request_user'))]"
/>
<field name="arch" type="xml">
<xpath expr="//div[@name='button_box']" position="inside">
<button
Expand All @@ -18,6 +14,7 @@
class="oe_stat_button"
icon="fa-chain"
attrs="{'invisible':[('stock_request_ids', '=', [])]}"
groups="stock_request.group_stock_request_user"
>
<field
name="stock_request_count"
Expand All @@ -28,7 +25,11 @@
</button>
</xpath>
<xpath expr="//field[@name='order_line']/form//notebook" position="inside">
<page name="stock_requests" string="Stock Requests">
<page
name="stock_requests"
string="Stock Requests"
groups="stock_request.group_stock_request_user"
>
<field name="stock_request_ids" />
</page>
</xpath>
Expand All @@ -38,14 +39,13 @@
<field name="name">purchase.order.line.form2</field>
<field name="model">purchase.order.line</field>
<field name="inherit_id" ref="purchase.purchase_order_line_form2" />
<field
name="groups_id"
eval="[(4, ref('stock_request.group_stock_request_user'))]"
/>
<field name="arch" type="xml">
<field name="name" position="after">
<separator string="Stock Requests" />
<field name="stock_request_ids" />
<field
name="stock_request_ids"
groups="stock_request.group_stock_request_user"
/>
</field>
</field>
</record>
Expand Down
2 changes: 1 addition & 1 deletion stock_request_purchase/views/stock_request_order_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<field name="name">stock.request.order.form</field>
<field name="model">stock.request.order</field>
<field name="inherit_id" ref="stock_request.stock_request_order_form" />
<field name="groups_id" eval="[(4, ref('purchase.group_purchase_user'))]" />
<field name="arch" type="xml">
<div name="button_box" position="inside">
<field name="purchase_ids" attrs="{'invisible': True}" />
Expand All @@ -16,6 +15,7 @@
class="oe_stat_button"
icon="fa-credit-card"
attrs="{'invisible': [('purchase_count', '=', 0)]}"
groups="purchase.group_purchase_user"
>
<field name="purchase_count" widget="statinfo" string="Purchase" />
</button>
Expand Down
2 changes: 1 addition & 1 deletion stock_request_purchase/views/stock_request_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<field name="name">stock.request.form</field>
<field name="model">stock.request</field>
<field name="inherit_id" ref="stock_request.view_stock_request_form" />
<field name="groups_id" eval="[(4, ref('purchase.group_purchase_user'))]" />
<field name="arch" type="xml">
<div name="button_box" position="inside">
<field name="purchase_ids" attrs="{'invisible': True}" />
Expand All @@ -16,6 +15,7 @@
class="oe_stat_button"
icon="fa-credit-card"
attrs="{'invisible': [('purchase_count', '=', 0)]}"
groups="purchase.group_purchase_user"
>
<field name="purchase_count" widget="statinfo" string="Purchase" />
</button>
Expand Down

0 comments on commit 4ed23f6

Please sign in to comment.