[MIG] Migrated mrp_production_putaway_strategy to v13.

This commit is contained in:
sudhir-erpharbor
2019-11-04 18:46:38 +05:30
committed by Joan Mateu Jordi
parent ef64b0a64b
commit a087b9e4ad
6 changed files with 19 additions and 20 deletions

View File

@@ -14,13 +14,13 @@ MRP Production Putaway Strategy
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmanufacture-lightgray.png?logo=github
:target: https://github.com/OCA/manufacture/tree/12.0/mrp_production_putaway_strategy
:target: https://github.com/OCA/manufacture/tree/13.0/mrp_production_putaway_strategy
:alt: OCA/manufacture
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/manufacture-12-0/manufacture-12-0-mrp_production_putaway_strategy
:target: https://translation.odoo-community.org/projects/manufacture-13-0/manufacture-13-0-mrp_production_putaway_strategy
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/129/12.0
:target: https://runbot.odoo-community.org/runbot/129/13.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -85,6 +85,7 @@ Contributors
* Jordi Ballester <jordi.ballester@eficent.com>
* Lois Rilo <lois.rilo@eficent.com>
* Sudhir Arya <sudhir@erpharbor.com>
Maintainers
~~~~~~~~~~~
@@ -99,6 +100,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/manufacture <https://github.com/OCA/manufacture/tree/12.0/mrp_production_putaway_strategy>`_ project on GitHub.
This module is part of the `OCA/manufacture <https://github.com/OCA/manufacture/tree/13.0/mrp_production_putaway_strategy>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@@ -5,7 +5,7 @@
"name": "MRP Production Putaway Strategy",
"summary": "Applies putaway strategies to manufacturing orders for "
"finished products.",
"version": "12.0.1.0.0",
"version": "13.0.1.0.0",
"author": "Eficent, "
"Odoo Community Association (OCA)",
"website": "https://github.com/OCA/manufacture",

View File

@@ -12,7 +12,7 @@ class MrpProduction(models.Model):
location_dest = self.env['stock.location'].browse(vals.get(
'location_dest_id'))
product = self.env['product.product'].browse(vals.get('product_id'))
location_id = location_dest.get_putaway_strategy(product)
location_id = location_dest._get_putaway_strategy(product)
if location_id:
vals['location_dest_id'] = location_id.id
mo = super(MrpProduction, self).create(vals)
@@ -21,5 +21,5 @@ class MrpProduction(models.Model):
"Applied Putaway strategy to finished products.\n"
"Finished Products Location: %s." %
mo.location_dest_id.complete_name)
mo.message_post(message, message_type='comment')
mo.message_post(body=message, message_type='comment')
return mo

View File

@@ -1,2 +1,3 @@
* Jordi Ballester <jordi.ballester@eficent.com>
* Lois Rilo <lois.rilo@eficent.com>
* Sudhir Arya <sudhir@erpharbor.com>

View File

@@ -367,7 +367,7 @@ ul.auto-toc {
!! 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/manufacture/tree/12.0/mrp_production_putaway_strategy"><img alt="OCA/manufacture" src="https://img.shields.io/badge/github-OCA%2Fmanufacture-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/manufacture-12-0/manufacture-12-0-mrp_production_putaway_strategy"><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/129/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/manufacture/tree/13.0/mrp_production_putaway_strategy"><img alt="OCA/manufacture" src="https://img.shields.io/badge/github-OCA%2Fmanufacture-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/manufacture-13-0/manufacture-13-0-mrp_production_putaway_strategy"><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/129/13.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module allows to apply putaway strategies to the products resulting from
the manufacturing orders.</p>
<p>The finished products will be placed in the location designated by the putaway
@@ -433,6 +433,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<ul class="simple">
<li>Jordi Ballester &lt;<a class="reference external" href="mailto:jordi.ballester&#64;eficent.com">jordi.ballester&#64;eficent.com</a>&gt;</li>
<li>Lois Rilo &lt;<a class="reference external" href="mailto:lois.rilo&#64;eficent.com">lois.rilo&#64;eficent.com</a>&gt;</li>
<li>Sudhir Arya &lt;<a class="reference external" href="mailto:sudhir&#64;erpharbor.com">sudhir&#64;erpharbor.com</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
@@ -442,7 +443,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<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/manufacture/tree/12.0/mrp_production_putaway_strategy">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/13.0/mrp_production_putaway_strategy">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>

View File

@@ -27,21 +27,17 @@ class MrpProductionCase(TransactionCase):
'usage': 'internal'
})
self.putaway_strategy = self.env['product.putaway'].create({
'name': 'Fixed Loc',
'method': 'fixed',
'fixed_location_ids': [(
0, 0, {'fixed_location_id': self.bin_loc_stock.id,
'category_id': self.category.id})]
})
self.loc_stock.putaway_strategy_id = self.putaway_strategy
self.loc_production = self.env.ref(
"stock.location_production")
self.product1 = self.env.ref("mrp.product_product_computer_desk")
self.product1.categ_id = self.category
self.bom1 = self.env.ref("mrp.mrp_bom_desk")
self.putaway_strategy = self.env['stock.putaway.rule'].create({
'product_id': self.product1.id,
'location_in_id': self.loc_stock.id,
'location_out_id': self.bin_loc_stock.id,
})
self.loc_stock.putaway_strategy_id = self.putaway_strategy
def _create_mo(self, product=False, bom=False, src_loc=False,
dest_loc=False, qty=10.0, uom=False):
if not product: