Skip to content

Commit

Permalink
[MIG] stock_availale_mrp: Migration to 13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ps-tubtim committed Jan 18, 2021
1 parent 6ec75c3 commit b78a942
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 48 deletions.
1 change: 1 addition & 0 deletions setup/stock_available_mrp/odoo/addons/stock_available_mrp
6 changes: 6 additions & 0 deletions setup/stock_available_mrp/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,
)
11 changes: 6 additions & 5 deletions stock_available_mrp/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ Consider the production potential is available to promise
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-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/12.0/stock_available_mrp
:target: https://github.com/OCA/stock-logistics-warehouse/tree/13.0/stock_available_mrp
:alt: OCA/stock-logistics-warehouse
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-12-0/stock-logistics-warehouse-12-0-stock_available_mrp
:target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-13-0/stock-logistics-warehouse-13-0-stock_available_mrp
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/153/12.0
:target: https://runbot.odoo-community.org/runbot/153/13.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand Down Expand Up @@ -88,7 +88,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-warehouse/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/stock-logistics-warehouse/issues/new?body=module:%20stock_available_mrp%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20stock_available_mrp%0Aversion:%2013.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 @@ -109,6 +109,7 @@ Contributors
* Laurent Mignon <laurent.mignon@acsone.eu>
* Cédric Pigeon <cedric.pigeon@acsone.eu>
* Florian da Costa <florian.dacosta@akretion.com>
* Pimolnat Suntian <pimolnats@ecosoft.co.th>

Maintainers
~~~~~~~~~~~
Expand All @@ -123,6 +124,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/12.0/stock_available_mrp>`_ project on GitHub.
This module is part of the `OCA/stock-logistics-warehouse <https://github.com/OCA/stock-logistics-warehouse/tree/13.0/stock_available_mrp>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
81 changes: 45 additions & 36 deletions stock_available_mrp/demo/mrp_data.xml
Original file line number Diff line number Diff line change
@@ -1,38 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="product_kit_1a" model="product.product">
<field name="default_code">PCSC234-WHITE</field>
<field name="product_tmpl_id"
ref="mrp.product_product_table_kit_product_template"/>
<field name="attribute_value_ids" eval="[(6,0,[ref('product.product_attribute_value_3')])]"/>
</record>

<record id="mrp.product_product_table_kit" model="product.product">
<field name="attribute_value_ids"
eval="[(6,0,[ref('product.product_attribute_value_4')])]"/>
</record>

<record id="mrp.mrp_bom_kit_line_2" model="mrp.bom.line">
<field name="attribute_value_ids" eval="[(6,0,[ref('product.product_attribute_value_4')])]"/>
</record>

<record id="product_computer_desk_bolt_white" model="product.product">
<field name="name">Bolt</field>
<field name="categ_id" ref="product.product_category_5"/>
<field name="standard_price">1.0</field>
<field name="list_price">5.0</field>
<field name="type">product</field>
<field name="uom_id" ref="uom.product_uom_unit"/>
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="default_code">BOLT-WHITE</field>
</record>

<record id="mrp_bom_kit_line_3" model="mrp.bom.line">
<field name="product_id" ref="product_computer_desk_bolt_white"/>
<field name="product_qty">4</field>
<field name="product_uom_id" ref="uom.product_uom_unit"/>
<field name="sequence">5</field>
<field name="bom_id" ref="mrp.mrp_bom_kit"/>
<field name="attribute_value_ids" eval="[(6,0,[ref('product.product_attribute_value_3')])]"/>
</record>
<record id="product_kit_1a" model="product.product">
<field name="default_code">PCSC234-WHITE</field>
<field
name="product_tmpl_id"
ref="mrp.product_product_table_kit_product_template"
/>
<field
name="product_template_attribute_value_ids"
eval="[(6,0,[ref('product.product_attribute_value_3')])]"
/>
</record>
<record id="mrp.product_product_table_kit" model="product.product">
<field
name="product_template_attribute_value_ids"
eval="[(6,0,[ref('product.product_attribute_value_4')])]"
/>
</record>
<record id="mrp.mrp_bom_kit_line_2" model="mrp.bom.line">
<field
name="product_template_attribute_value_ids"
eval="[(6,0,[ref('product.product_attribute_value_4')])]"
/>
</record>
<record id="product_computer_desk_bolt_white" model="product.product">
<field name="name">Bolt</field>
<field name="categ_id" ref="product.product_category_5" />
<field name="standard_price">1.0</field>
<field name="list_price">5.0</field>
<field name="type">product</field>
<field name="uom_id" ref="uom.product_uom_unit" />
<field name="uom_po_id" ref="uom.product_uom_unit" />
<field name="default_code">BOLT-WHITE</field>
</record>
<record id="mrp_bom_kit_line_3" model="mrp.bom.line">
<field name="product_id" ref="product_computer_desk_bolt_white" />
<field name="product_qty">4</field>
<field name="product_uom_id" ref="uom.product_uom_unit" />
<field name="sequence">5</field>
<field name="bom_id" ref="mrp.mrp_bom_kit" />
<field
name="product_template_attribute_value_ids"
eval="[(6,0,[ref('product.product_attribute_value_3')])]"
/>
</record>
</odoo>
4 changes: 0 additions & 4 deletions stock_available_mrp/models/product_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class ProductProduct(models.Model):
def _compute_available_quantities(self):
super(ProductProduct, self)._compute_available_quantities()

@api.multi
def _get_bom_id_domain(self):
"""
Real multi domain
Expand All @@ -31,7 +30,6 @@ def _get_bom_id_domain(self):
("product_tmpl_id", "in", self.mapped("product_tmpl_id.id")),
]

@api.multi
@api.depends("product_tmpl_id")
def _compute_bom_id(self):
bom_obj = self.env["mrp.bom"]
Expand All @@ -44,7 +42,6 @@ def _compute_bom_id(self):
if product_boms:
product.bom_id = first(product_boms)

@api.multi
def _compute_available_quantities_dict(self):
res, stock_dict = super(
ProductProduct, self
Expand Down Expand Up @@ -117,7 +114,6 @@ def _compute_available_quantities_dict(self):

return res, stock_dict

@api.multi
def _explode_boms(self):
"""
return a dict by product_id of exploded bom lines
Expand Down
1 change: 1 addition & 0 deletions stock_available_mrp/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
* Laurent Mignon <laurent.mignon@acsone.eu>
* Cédric Pigeon <cedric.pigeon@acsone.eu>
* Florian da Costa <florian.dacosta@akretion.com>
* Pimolnat Suntian <pimolnats@ecosoft.co.th>
7 changes: 4 additions & 3 deletions stock_available_mrp/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Consider the production potential is available to promise</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/stock-logistics-warehouse/tree/12.0/stock_available_mrp"><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" href="https://translation.odoo-community.org/projects/stock-logistics-warehouse-12-0/stock-logistics-warehouse-12-0-stock_available_mrp"><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/153/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/stock-logistics-warehouse/tree/13.0/stock_available_mrp"><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" href="https://translation.odoo-community.org/projects/stock-logistics-warehouse-13-0/stock-logistics-warehouse-13-0-stock_available_mrp"><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/153/13.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module takes the potential quantities available for Products into account in
the quantity available to promise, where the “Potential quantity” is the
quantity that can be manufactured with the components immediately at hand.
Expand Down Expand Up @@ -439,7 +439,7 @@ <h1><a class="toc-backref" href="#id5">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>.
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/stock-logistics-warehouse/issues/new?body=module:%20stock_available_mrp%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/stock-logistics-warehouse/issues/new?body=module:%20stock_available_mrp%0Aversion:%2013.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 @@ -459,6 +459,7 @@ <h2><a class="toc-backref" href="#id8">Contributors</a></h2>
<li>Laurent Mignon &lt;<a class="reference external" href="mailto:laurent.mignon&#64;acsone.eu">laurent.mignon&#64;acsone.eu</a>&gt;</li>
<li>Cédric Pigeon &lt;<a class="reference external" href="mailto:cedric.pigeon&#64;acsone.eu">cedric.pigeon&#64;acsone.eu</a>&gt;</li>
<li>Florian da Costa &lt;<a class="reference external" href="mailto:florian.dacosta&#64;akretion.com">florian.dacosta&#64;akretion.com</a>&gt;</li>
<li>Pimolnat Suntian &lt;<a class="reference external" href="mailto:pimolnats&#64;ecosoft.co.th">pimolnats&#64;ecosoft.co.th</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand All @@ -468,7 +469,7 @@ <h2><a class="toc-backref" href="#id9">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/12.0/stock_available_mrp">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-warehouse/tree/13.0/stock_available_mrp">OCA/stock-logistics-warehouse</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

0 comments on commit b78a942

Please sign in to comment.