Skip to content

Commit

Permalink
[IMP] stock_pull_list: Rewrite code with help of review
Browse files Browse the repository at this point in the history
  • Loading branch information
solo4games committed Oct 9, 2023
1 parent 551eba7 commit d855feb
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
1 change: 1 addition & 0 deletions stock_pull_list/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"wizards/stock_pull_list_wizard.xml",
"security/ir.model.access.csv",
"data/stock_pull_list_sequence_data.xml",
"data/data.xml",
"views/stock_picking_views.xml",
],
"installable": True,
Expand Down
11 changes: 11 additions & 0 deletions stock_pull_list/data/data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<odoo>
<record model="ir.actions.server" id="stock_generate_pull_list">
<field name="name">Generate Pull List</field>
<field name="model_id" ref="stock.model_stock_picking" />
<field name="binding_model_id" ref="stock.model_stock_picking" />
<field name="state">code</field>
<field name="code">
action = records.action_create_pull_list()
</field>
</record>
</odoo>
2 changes: 1 addition & 1 deletion stock_pull_list/models/stock_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class StockPicking(models.Model):

def action_create_pull_list(self):

source_location = self[0].location_id
source_location = fields.first(self).location_id
for record in self:
if source_location != record.location_id:
raise UserError(_("Choose transfers with same source location"))
Expand Down
10 changes: 0 additions & 10 deletions stock_pull_list/views/stock_picking_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,4 @@
</xpath>
</field>
</record>

<record model="ir.actions.server" id="stock_generate_pull_list">
<field name="name">Generate Pull List</field>
<field name="model_id" ref="stock.model_stock_picking" />
<field name="binding_model_id" ref="stock.model_stock_picking" />
<field name="state">code</field>
<field name="code">
action = records.action_create_pull_list()
</field>
</record>
</odoo>

0 comments on commit d855feb

Please sign in to comment.