Skip to content

Commit

Permalink
Remarks from Guewen + Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jbaudoux committed Aug 15, 2019
1 parent add0b0b commit 83cdfbf
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 84 deletions.
2 changes: 1 addition & 1 deletion setup/stock_location_zone/odoo/addons/stock_location_zone
3 changes: 1 addition & 2 deletions stock_location_zone/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
'stock',
],
'data': [
'views/picking_zone.xml',
'views/picking_type.xml',
'views/stock_picking_zone.xml',
'views/stock_location.xml',
'security/ir.model.access.csv',
],
Expand Down
3 changes: 1 addition & 2 deletions stock_location_zone/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
from . import picking_type
from . import picking_zone
from . import stock_picking_zone
from . import stock_location
10 changes: 0 additions & 10 deletions stock_location_zone/models/picking_type.py

This file was deleted.

12 changes: 6 additions & 6 deletions stock_location_zone/models/stock_location.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class StockLocation(models.Model):
string='Kind')

picking_zone_id = fields.Many2one(
'picking.zone',
'stock.picking.zone',
string='Picking zone')

picking_type_id = fields.Many2one(
Expand Down Expand Up @@ -49,9 +49,9 @@ def _compute_area(self):
location_name_format = fields.Char(
'Location Name Format',
help="Format string that will compute the name of the location. "
"Use 'self' to access location object. Example: "
"'{self.area}-{self.corridor:0>2}.{self.rack:0>3}"
".{self.level:0>2}'")
"Use location fields. Example: "
"'{area}-{corridor:0>2}.{rack:0>3}"
".{level:0>2}'")

@api.multi
@api.onchange('corridor', 'row', 'rack', 'level',
Expand All @@ -63,10 +63,10 @@ def _compute_name(self):
area = location
while not area.location_name_format:
if not area.location_id:
continue
return
area = area.location_id
location.name = area.location_name_format\
.format(self=location)
.format(**location.read())

_sql_constraints = [
(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


class PickingZone(models.Model):
_name = 'picking.zone'
_name = 'stock.picking.zone'

name = fields.Char('Name', required=True, translate=True)
code = fields.Char('Code', required=True)
Expand Down
4 changes: 2 additions & 2 deletions stock_location_zone/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_picking_zone,access_picking_zone,model_picking_zone,base.group_user,1,0,0,0
access_picking_zone_manager,access_picking_zone_manager,model_picking_zone,base.group_system,1,1,1,1
access_picking_zone,access_picking_zone,model_stock_picking_zone,base.group_user,1,0,0,0
access_picking_zone_manager,access_picking_zone_manager,model_stock_picking_zone,base.group_system,1,1,1,1
35 changes: 0 additions & 35 deletions stock_location_zone/views/picking_type.xml

This file was deleted.

24 changes: 0 additions & 24 deletions stock_location_zone/views/picking_zone.xml

This file was deleted.

2 changes: 1 addition & 1 deletion stock_location_zone/views/stock_location.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<field name="usage" position="after">
<field name="kind" />
<field name="location_name_format" />
<field name="location_name_format" attrs="{'invisible': [('kind', '=', 'bin')]}" />
<field name="picking_type_id" options="{'no_create': True}" attrs="{'readonly': [('kind', '!=', 'zone')]}" />
</field>

Expand Down
41 changes: 41 additions & 0 deletions stock_location_zone/views/stock_picking_zone.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="picking_zone_view_filter" model="ir.ui.view">
<field name="name">stock.picking.zone.view.filter</field>
<field name="model">stock.picking.zone</field>
<field name="arch" type="xml">
<search string="Picking Zones">
<field name="name"/>
<field name="code"/>
</search>
</field>
</record>
<record id="picking_zone_view_tree" model="ir.ui.view">
<field name="name">stock.picking.zone.view.tree</field>
<field name="model">stock.picking.zone</field>
<field name="arch" type="xml">
<tree string="Picking Zones" editable="bottom">
<field name="name"/>
<field name="code"/>
<field name="pick_type_id"/>
</tree>
</field>
</record>

<record id="action_picking_zone" model="ir.actions.act_window">
<field name="name">Picking Zones</field>
<field name="res_model">stock.picking.zone</field>
<field name="type">ir.actions.act_window</field>
<field name="view_type">form</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Define the picking zones of your warehouses
</p>
</field>
</record>

<menuitem id="picking_zone_menu"
action="action_picking_zone"
parent="stock.menu_warehouse_config"
sequence="2"/>
</odoo>

0 comments on commit 83cdfbf

Please sign in to comment.