[MIG] stock_putaway_method: Migration to 14.0

This commit is contained in:
Reed Hayashikawa
2021-07-09 13:04:10 -07:00
parent 646f9423e0
commit ce255ebdba
4 changed files with 9 additions and 9 deletions

View File

@@ -3,7 +3,7 @@
"name": "Putaway strategy method", "name": "Putaway strategy method",
"summary": "Add the putaway strategy method back, " "summary": "Add the putaway strategy method back, "
"removed from the stock module in Odoo 12", "removed from the stock module in Odoo 12",
"version": "12.0.1.0.0", "version": "14.0.1.0.0",
"category": "Inventory", "category": "Inventory",
"website": "https://github.com/OCA/stock-logistics-warehouse", "website": "https://github.com/OCA/stock-logistics-warehouse",
"author": "Camptocamp SA, " "Odoo Community Association (OCA)", "author": "Camptocamp SA, " "Odoo Community Association (OCA)",

View File

@@ -2,8 +2,8 @@
from odoo import api, fields, models from odoo import api, fields, models
class PutAwayStrategy(models.Model): class StockPutawayRule(models.Model):
_inherit = "product.putaway" _inherit = "stock.putaway.rule"
method = fields.Selection( method = fields.Selection(
selection="_get_putaway_options", selection="_get_putaway_options",

View File

@@ -8,5 +8,5 @@ class TestPutawayMethod(TransactionCase):
# Check if "fixed" is a valid putaway method # Check if "fixed" is a valid putaway method
def test_01_putaway_methods(self): def test_01_putaway_methods(self):
field_method = self.env["product.putaway"]._fields.get("method") field_method = self.env["stock.putaway.rule"]._fields.get("method")
self.assertIn("fixed", field_method.get_values(self.env)) self.assertIn("fixed", field_method.get_values(self.env))

View File

@@ -1,14 +1,14 @@
<odoo> <odoo>
<record id="view_putaway" model="ir.ui.view"> <record id="view_putaway" model="ir.ui.view">
<field name="name">product.putaway.form.method</field> <field name="name">stock.putaway.rule.form.method</field>
<field name="model">product.putaway</field> <field name="model">stock.putaway.rule</field>
<field name="inherit_id" ref="stock.view_putaway" /> <field name="inherit_id" ref="stock.stock_putaway_list" />
<field name="arch" type="xml"> <field name="arch" type="xml">
<field name="name" position="after"> <field name="location_out_id" position="after">
<field name="method" /> <field name="method" />
</field> </field>
<field name="fixed_location_ids" position="attributes"> <field name="location_in_id" position="attributes">
<attribute <attribute
name="attrs" name="attrs"
>{'invisible': [('method', '!=', 'fixed')]}</attribute> >{'invisible': [('method', '!=', 'fixed')]}</attribute>