[IMP] stock_putaway_method: black, isort, prettier

This commit is contained in:
Reed Hayashikawa
2021-07-06 16:40:25 -07:00
parent c546eba20e
commit 646f9423e0
6 changed files with 31 additions and 28 deletions

View File

@@ -0,0 +1 @@
../../../../stock_putaway_method

View File

@@ -0,0 +1,6 @@
import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)

View File

@@ -1,21 +1,15 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Putaway strategy method',
'summary': 'Add the putaway strategy method back, '
'removed from the stock module in Odoo 12',
'version': '12.0.1.0.0',
'category': 'Inventory',
'website': 'https://github.com/OCA/stock-logistics-warehouse',
'author': 'Camptocamp SA, '
'Odoo Community Association (OCA)',
'license': 'AGPL-3',
'depends': [
'product',
'stock'
],
'data': [
'views/product_strategy_views.xml'
],
'development_status': 'Production/Stable',
'maintainers': ['asaunier'],
"name": "Putaway strategy method",
"summary": "Add the putaway strategy method back, "
"removed from the stock module in Odoo 12",
"version": "12.0.1.0.0",
"category": "Inventory",
"website": "https://github.com/OCA/stock-logistics-warehouse",
"author": "Camptocamp SA, " "Odoo Community Association (OCA)",
"license": "AGPL-3",
"depends": ["product", "stock"],
"data": ["views/product_strategy_views.xml"],
"development_status": "Production/Stable",
"maintainers": ["asaunier"],
}

View File

@@ -3,15 +3,15 @@ from odoo import api, fields, models
class PutAwayStrategy(models.Model):
_inherit = 'product.putaway'
_inherit = "product.putaway"
method = fields.Selection(
selection='_get_putaway_options',
string='Method',
default='fixed',
selection="_get_putaway_options",
string="Method",
default="fixed",
required=True,
)
@api.model
def _get_putaway_options(self):
return [('fixed', 'Fixed Location')]
return [("fixed", "Fixed Location")]

View File

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

View File

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