Skip to content

Commit

Permalink
[MIG] product_mrp_info: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
anusriNPS committed Aug 2, 2024
1 parent ea665d6 commit 50b0d3e
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 49 deletions.
10 changes: 5 additions & 5 deletions product_mrp_info/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ Product MRP Info
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmanufacture-lightgray.png?logo=github
:target: https://github.com/OCA/manufacture/tree/14.0/product_mrp_info
:target: https://github.com/OCA/manufacture/tree/16.0/product_mrp_info
:alt: OCA/manufacture
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/manufacture-14-0/manufacture-14-0-product_mrp_info
:target: https://translation.odoo-community.org/projects/manufacture-16-0/manufacture-16-0-product_mrp_info
: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/manufacture&target_branch=14.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/manufacture&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand All @@ -48,7 +48,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/manufacture/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/manufacture/issues/new?body=module:%20product_mrp_info%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/manufacture/issues/new?body=module:%20product_mrp_info%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 Down Expand Up @@ -87,6 +87,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-LoisRForgeFlow|

This module is part of the `OCA/manufacture <https://github.com/OCA/manufacture/tree/14.0/product_mrp_info>`_ project on GitHub.
This module is part of the `OCA/manufacture <https://github.com/OCA/manufacture/tree/16.0/product_mrp_info>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 1 addition & 1 deletion product_mrp_info/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{
"name": "Product MRP Info",
"version": "14.0.1.0.0",
"version": "16.0.1.0.0",
"development_status": "Beta",
"license": "LGPL-3",
"author": "ForgeFlow, Odoo Community Association (OCA)",
Expand Down
18 changes: 10 additions & 8 deletions product_mrp_info/static/description/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
Expand All @@ -9,10 +8,11 @@

/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.

Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.

See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
Expand Down Expand Up @@ -275,7 +275,7 @@
margin-left: 2em ;
margin-right: 2em }

pre.code .ln { color: grey; } /* line numbers */
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
Expand All @@ -301,7 +301,7 @@
span.pre {
white-space: pre }

span.problematic {
span.problematic, pre.problematic {
color: red }

span.section-subtitle {
Expand Down Expand Up @@ -369,7 +369,7 @@ <h1 class="title">Product MRP Info</h1>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:6890efe3aa93e30c39e9a91a505e7dd9250a005de16764dcaf79bde50de06e00
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/manufacture/tree/14.0/product_mrp_info"><img alt="OCA/manufacture" src="https://img.shields.io/badge/github-OCA%2Fmanufacture-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/manufacture-14-0/manufacture-14-0-product_mrp_info"><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/manufacture&amp;target_branch=14.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/manufacture/tree/16.0/product_mrp_info"><img alt="OCA/manufacture" src="https://img.shields.io/badge/github-OCA%2Fmanufacture-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/manufacture-16-0/manufacture-16-0-product_mrp_info"><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/manufacture&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>Adds smart button in product form view linking to manufacturing order list.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
Expand All @@ -395,7 +395,7 @@ <h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/manufacture/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/manufacture/issues/new?body=module:%20product_mrp_info%0Aversion:%2014.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/manufacture/issues/new?body=module:%20product_mrp_info%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 @@ -416,13 +416,15 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
</a>
<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>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
<p><a class="reference external image-reference" href="https://github.com/LoisRForgeFlow"><img alt="LoisRForgeFlow" src="https://github.com/LoisRForgeFlow.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/manufacture/tree/14.0/product_mrp_info">OCA/manufacture</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/manufacture/tree/16.0/product_mrp_info">OCA/manufacture</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
67 changes: 34 additions & 33 deletions product_mrp_info/tests/test_product_mrp_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,72 +5,73 @@


class TestProductMrpInfo(TransactionCase):
def setUp(self):
super().setUp()
self.pt_obj = self.env["product.template"]
self.pp_obj = self.env["product.product"]
self.mo_obj = self.env["mrp.production"]
self.bom_obj = self.env["mrp.bom"]
self.boml_obj = self.env["mrp.bom.line"]
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.pt_obj = cls.env["product.template"]
cls.pp_obj = cls.env["product.product"]
cls.mo_obj = cls.env["mrp.production"]
cls.bom_obj = cls.env["mrp.bom"]
cls.boml_obj = cls.env["mrp.bom.line"]

self.manufacture_route = self.env.ref("mrp.route_warehouse0_manufacture")
cls.manufacture_route = cls.env.ref("mrp.route_warehouse0_manufacture")

self.attribute = self.env["product.attribute"].create(
cls.attribute = cls.env["product.attribute"].create(
{"name": "Test Attribute", "create_variant": "always"}
)
self.value1 = self.env["product.attribute.value"].create(
{"name": "Value 1", "attribute_id": self.attribute.id}
cls.value1 = cls.env["product.attribute.value"].create(
{"name": "Value 1", "attribute_id": cls.attribute.id}
)
self.value2 = self.env["product.attribute.value"].create(
{"name": "Value 2", "attribute_id": self.attribute.id}
cls.value2 = cls.env["product.attribute.value"].create(
{"name": "Value 2", "attribute_id": cls.attribute.id}
)
self.product = self.pt_obj.create(
cls.product = cls.pt_obj.create(
{
"name": "Test Template",
"attribute_line_ids": [
(
0,
0,
{
"attribute_id": self.attribute.id,
"value_ids": [(6, 0, [self.value1.id, self.value2.id])],
"attribute_id": cls.attribute.id,
"value_ids": [(6, 0, [cls.value1.id, cls.value2.id])],
},
)
],
"route_ids": [(6, 0, self.manufacture_route.ids)],
"route_ids": [(6, 0, cls.manufacture_route.ids)],
}
)
self.variant_1 = self.product.product_variant_ids[0]
self.variant_2 = self.product.product_variant_ids[1]
self.bom = self.bom_obj.create(
{"product_tmpl_id": self.product.id, "product_qty": 1.0}
cls.variant_1 = cls.product.product_variant_ids[0]
cls.variant_2 = cls.product.product_variant_ids[1]
cls.bom = cls.bom_obj.create(
{"product_tmpl_id": cls.product.id, "product_qty": 1.0}
)
# Create 3 MO's
self.mo_1 = self.mo_obj.create(
cls.mo_1 = cls.mo_obj.create(
{
"name": "MO ABC",
"product_id": self.variant_1.id,
"product_uom_id": self.variant_1.uom_id.id,
"product_id": cls.variant_1.id,
"product_uom_id": cls.variant_1.uom_id.id,
"product_qty": 2,
"bom_id": self.bom.id,
"bom_id": cls.bom.id,
}
)
self.mo_2 = self.mo_obj.create(
cls.mo_2 = cls.mo_obj.create(
{
"name": "MO XYZ",
"product_id": self.variant_1.id,
"product_uom_id": self.variant_1.uom_id.id,
"product_id": cls.variant_1.id,
"product_uom_id": cls.variant_1.uom_id.id,
"product_qty": 3,
"bom_id": self.bom.id,
"bom_id": cls.bom.id,
}
)
self.mo_3 = self.mo_obj.create(
cls.mo_3 = cls.mo_obj.create(
{
"name": "MO QWE",
"product_id": self.variant_2.id,
"product_uom_id": self.variant_2.uom_id.id,
"product_id": cls.variant_2.id,
"product_uom_id": cls.variant_2.uom_id.id,
"product_qty": 6,
"bom_id": self.bom.id,
"bom_id": cls.bom.id,
}
)

Expand Down
4 changes: 2 additions & 2 deletions product_mrp_info/views/product_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<field name="name">product.template - product_mrp_info</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_only_form_view" />
<field name="groups_id" eval="[(4, ref('mrp.group_mrp_user'))]" />
<field name="arch" type="xml">
<div class="oe_button_box" position="inside">
<button
Expand All @@ -16,6 +15,7 @@
attrs="{'invisible':[('type', 'not in', ['product', 'consu'])]}"
icon="fa-wrench"
help="Manufactured Orders"
groups="mrp.group_mrp_user"
>
<field string="MO's" name="mo_count" widget="statinfo" />
</button>
Expand All @@ -28,7 +28,6 @@
<field name="name">product.product - product_mrp_info</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_normal_form_view" />
<field name="groups_id" eval="[(4, ref('mrp.group_mrp_user'))]" />
<field name="arch" type="xml">
<div class="oe_button_box" position="inside">
<button
Expand All @@ -38,6 +37,7 @@
attrs="{'invisible': [('type', 'not in', ['product', 'consu'])]}"
icon="fa-wrench"
help="Manufactured Orders"
groups="mrp.group_mrp_user"
>
<field string="MO's" name="mo_count" widget="statinfo" />
</button>
Expand Down

0 comments on commit 50b0d3e

Please sign in to comment.