mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[IMP] stock_putaway_method: black, isort, prettier
This commit is contained in:
1
setup/stock_putaway_method/odoo/addons/stock_putaway_method
Symbolic link
1
setup/stock_putaway_method/odoo/addons/stock_putaway_method
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../../stock_putaway_method
|
||||
6
setup/stock_putaway_method/setup.py
Normal file
6
setup/stock_putaway_method/setup.py
Normal file
@@ -0,0 +1,6 @@
|
||||
import setuptools
|
||||
|
||||
setuptools.setup(
|
||||
setup_requires=['setuptools-odoo'],
|
||||
odoo_addon=True,
|
||||
)
|
||||
@@ -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"],
|
||||
}
|
||||
|
||||
@@ -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")]
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user