Skip to content

Commit

Permalink
[MIG] migration stock_picking_batch_extended from 15.0 to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
BorisFL committed Mar 21, 2023
1 parent 1a1afea commit f8ad4d7
Show file tree
Hide file tree
Showing 23 changed files with 362 additions and 397 deletions.
15 changes: 8 additions & 7 deletions stock_picking_batch_extended/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# Copyright 2012-2014 Alexandre Fayolle, Camptocamp SA
# Copyright 2018-2020 Tecnativa - Carlos Dauden
# Copyright 2017 FactorLibre - Boris Alias
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Stock batch picking extended",
"summary": "Allows manage a lot of pickings in batch",
"version": "15.0.2.0.0",
"author": "Camptocamp, " "Tecnativa, " "Odoo Community Association (OCA)",
"version": "16.0.1.0.0",
"author": "Camptocamp, "
"Tecnativa, "
"FactorLibre, "
"Odoo Community Association (OCA)",
"development_status": "Mature",
"maintainers": ["gurneyalex", "carlosdauden", "i-vyshnevska"],
"maintainers": ["gurneyalex", "carlosdauden", "i-vyshnevska", "BorisFL"],
"category": "Warehouse Management",
"depends": ["stock_picking_batch", "delivery"],
"website": "https://github.com/OCA/stock-logistics-workflow",
Expand All @@ -19,10 +21,9 @@
"views/product_product.xml",
"views/report_batch_picking.xml",
"views/stock_warehouse.xml",
"views/stock_picking.xml",
"views/res_config_settings_views.xml",
"wizard/stock_picking_to_batch_views.xml",
],
"installable": True,
"post_init_hook": "post_init_hook",
"license": "AGPL-3",
}
21 changes: 9 additions & 12 deletions stock_picking_batch_extended/data/batch_picking_actions_server.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2018 Tecnativa - Carlos Dauden
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>
<!-- Stock Batch Picking - Print Picking Operations -->
<record id="action_print_batch_picking_operations" model="ir.actions.server">
Expand All @@ -10,11 +8,11 @@
name="binding_model_id"
ref="stock_picking_batch.model_stock_picking_batch"
/>
<field name="type">ir.actions.server</field>
<field name="state">code</field>
<field
name="code"
>pickings = records.mapped('picking_ids').filtered(lambda p: p.state != 'cancel')
action = env.ref('stock.action_report_picking').report_action(pickings)
<field name="code">
pickings = records.mapped('picking_ids').filtered(lambda p: p.state != 'cancel')
action = env['ir.actions.report'].sudo()._get_report_from_name('stock.report_picking').report_action(pickings)
</field>
</record>
<!-- Stock Batch Picking - Print Delivery Slip -->
Expand All @@ -26,10 +24,9 @@ action = env.ref('stock.action_report_picking').report_action(pickings)
ref="stock_picking_batch.model_stock_picking_batch"
/>
<field name="state">code</field>
<field
name="code"
>pickings = records.mapped('picking_ids').filtered(lambda p: p.state != 'cancel')
action = env.ref('stock.action_report_delivery').report_action(pickings)
<field name="code">
pickings = records.mapped('picking_ids').filtered(lambda p: p.state != 'cancel')
action = env['ir.actions.report'].sudo()._get_report_from_name('stock.report_delivery').report_action(pickings)
</field>
</record>
<record model="ir.actions.server" id="action_stock_batch_picking_assign_all">
Expand All @@ -41,8 +38,8 @@ action = env.ref('stock.action_report_delivery').report_action(pickings)
/>
<field name="state">code</field>
<field name="code">
for record in records:
record.action_assign()
for record in records:
record.action_assign()
</field>
</record>
</odoo>
5 changes: 2 additions & 3 deletions stock_picking_batch_extended/hooks.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# Copyright 2019 Camptocamp - Iryna Vyshnevska
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from odoo import SUPERUSER_ID, api


def post_init_hook(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})

env["res.company"].search([]).write({"use_oca_batch_validation": True})
company = env["res.company"].search([])
company.write({"use_oca_batch_validation": True})
Loading

0 comments on commit f8ad4d7

Please sign in to comment.