Skip to content

Commit

Permalink
[IMP] Stock: Usability changes
Browse files Browse the repository at this point in the history
		1. Incoming shipment changed to Receipts
		2. Outgoing shipment changed to Deliveries
		3. Warehouse configuration changed to Workflows Configuration
		4. New page for Resupply Configuration is added
		5. get_route_name method will return a dictionary

This commit is related to task 27785.
  • Loading branch information
hch-odoo committed Mar 20, 2018
1 parent 1b905aa commit db5c7d4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
22 changes: 11 additions & 11 deletions addons/stock/models/stock_warehouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@ class Warehouse(models.Model):
'Routes', domain="[('warehouse_selectable', '=', True)]",
help='Defaults routes through the warehouse')
reception_steps = fields.Selection([
('one_step', 'Receive goods directly in stock (1 step)'),
('two_steps', 'Unload in input location then go to stock (2 steps)'),
('three_steps', 'Unload in input location, go through a quality control before being admitted in stock (3 steps)')],
'Incoming Shipments', default='one_step', required=True,
('one_step', 'Vendor > Stock'),
('two_steps', 'Vendor > Input > Stock'),
('three_steps', 'Vendor > Input > Quality > Stock')],
'Receipts', default='one_step', required=True,
help="Default incoming route to follow")
delivery_steps = fields.Selection([
('ship_only', 'Ship directly from stock (Ship only)'),
('pick_ship', 'Bring goods to output location before shipping (Pick + Ship)'),
('pick_pack_ship', 'Make packages into a dedicated location, then bring them to the output location for shipping (Pick + Pack + Ship)')],
'Outgoing Shippings', default='ship_only', required=True,
('ship_only', 'Stock > Customer'),
('pick_ship', 'Stock > Output > Customer'),
('pick_pack_ship', 'Stock > Output > Packing Zone > Customer')],
'Deliveries', default='ship_only', required=True,
help="Default outgoing route to follow")
wh_input_stock_loc_id = fields.Many2one('stock.location', 'Input Location')
wh_qc_stock_loc_id = fields.Many2one('stock.location', 'Quality Control Location')
Expand Down Expand Up @@ -428,12 +428,12 @@ def _get_partner_locations(self):
raise UserError(_('Can\'t find any customer or supplier location.'))
return customer_loc, supplier_loc

def _get_route_name(self, route_type):
def _get_route_name(self):
names = {'one_step': _('Receipt in 1 step'), 'two_steps': _('Receipt in 2 steps'),
'three_steps': _('Receipt in 3 steps'), 'crossdock': _('Cross-Dock'),
'ship_only': _('Ship Only'), 'pick_ship': _('Pick + Ship'),
'pick_pack_ship': _('Pick + Pack + Ship')}
return names[route_type]
return names

def get_routes_dict(self):
# TDE todo: rename me (was get_routes_dict)
Expand Down Expand Up @@ -696,7 +696,7 @@ def _format_rulename(self, from_loc, dest_loc, suffix):

def _format_routename(self, name=None, route_type=None):
if route_type:
name = self._get_route_name(route_type)
name = self._get_route_name()[route_type]
return '%s: %s' % (self.name, name)

@api.returns('self')
Expand Down
6 changes: 5 additions & 1 deletion addons/stock/views/stock_warehouse_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,14 @@
</group>
</group>
<notebook colspan="4" groups="stock.group_adv_location">
<page string="Warehouse Configuration" colspan="4">
<page string="Workflows Configuration" colspan="4">
<group colspan="4">
<field name="reception_steps" widget='radio'/>
<field name="delivery_steps" widget='radio'/>
</group>
</page>
<page string="Resupply Configuration" colspan="4">
<group colspan="4">
<field name="default_resupply_wh_id" widget='selection'/>
<field name="resupply_wh_ids" domain="[('id', '!=', id)]" widget='many2many_checkboxes'/>
</group>
Expand Down

0 comments on commit db5c7d4

Please sign in to comment.