Skip to content

Commit

Permalink
[IMP] stock: remove field 'method' from 'product.putaway'
Browse files Browse the repository at this point in the history
Because it wasn't used anymore.
  • Loading branch information
hbh-odoo authored and jorenvo committed Sep 7, 2017
1 parent be7ac3a commit f292682
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 21 deletions.
11 changes: 1 addition & 10 deletions addons/stock/models/product_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,11 @@ class PutAwayStrategy(models.Model):
_description = 'Put Away Strategy'

name = fields.Char('Name', required=True)
method = fields.Selection('_get_putaway_options', "Method", default='fixed', required=True)
fixed_location_ids = fields.One2many(
'stock.fixed.putaway.strat', 'putaway_id', 'Fixed Locations Per Product Category', copy=True,
help="When the method is fixed, this location will be used to store the products")

def _get_putaway_options(self):
return [('fixed', 'Fixed Location')]

def _putaway_apply_fixed(self, product):
def putaway_apply(self, product):
for strat in self.fixed_location_ids:
categ = product.categ_id
while categ:
Expand All @@ -34,11 +30,6 @@ def _putaway_apply_fixed(self, product):
categ = categ.parent_id
return self.env['stock.location']

def putaway_apply(self, product):
if hasattr(self, '_putaway_apply_%s' % (self.method)):
return getattr(self, '_putaway_apply_%s' % (self.method))(product)
return self.env['stock.location']


class FixedPutAwayStrategy(models.Model):
_name = 'stock.fixed.putaway.strat'
Expand Down
19 changes: 8 additions & 11 deletions addons/stock/views/product_strategy_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,15 @@
<form string="Putaway">
<group colspan="4">
<field name="name"/>
<field name="method"/>
</group>
<div attrs="{'invisible': [('method', '!=', 'fixed')]}">
<separator string="Fixed Locations Per Categories"/>
<field name="fixed_location_ids" colspan="4" nolabel="1">
<tree editable="top">
<field name="sequence" widget='handle'/>
<field name="category_id"/>
<field name="fixed_location_id"/>
</tree>
</field>
</div>
<separator string="Fixed Locations Per Categories"/>
<field name="fixed_location_ids" colspan="4" nolabel="1">
<tree editable="top">
<field name="sequence" widget='handle'/>
<field name="category_id"/>
<field name="fixed_location_id"/>
</tree>
</field>
</form>
</field>
</record>
Expand Down

0 comments on commit f292682

Please sign in to comment.