-
-
Notifications
You must be signed in to change notification settings - Fork 671
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[18.0][MIG] stock_picking_batch_extended: Migration to 18.0 #1855
base: 18.0
Are you sure you want to change the base?
Changes from 1 commit
fd7b27d
39f72d9
5b6ff38
460caec
f622b99
85d6a8b
231490c
41e138a
d8a696f
68c8209
b83a6c6
91fa013
f77b2ba
670fe69
6593163
6741982
b045dae
9e660df
b328d10
0960f0d
b81ea70
e6ff417
90d43be
a7a323a
2b4384e
45ee5d8
ecb2a45
e49958a
e2cc5af
dc9fc57
0b1caa1
c7f0587
ec1ac65
465c349
650f479
c4f8dc7
1ec7f8f
cc33752
e21adcc
794b80d
c450435
ed5bf48
e6cd55b
d5596ec
505adfa
b4417df
4394b81
e546377
19a1a5b
208da54
a3a7973
3d36345
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
# 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, {}) | ||
|
||
def post_init_hook(env): | ||
env["res.company"].search([]).write({"use_oca_batch_validation": True}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright 2025 Camptocamp SA | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
|
||
def migrate(cr, version): | ||
cr.execute(""" | ||
UPDATE product_template | ||
SET description_picking = | ||
CASE | ||
WHEN description_picking IS NOT NULL THEN | ||
description_picking || '\n' || description_warehouse | ||
ELSE | ||
description_warehouse | ||
END | ||
WHERE description_warehouse IS NOT NULL; | ||
""") |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
from odoo import fields, models | ||
|
||
|
||
class Product(models.Model): | ||
_inherit = "product.product" | ||
# TODO: Integrate in existent field | ||
description_warehouse = fields.Text("Warehouse Description", translate=True) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suppose |
||
class ProductTemplate(models.Model): | ||
_inherit = "product.template" | ||
|
||
description_picking = fields.Text(string="Warehouse Description", translate=True) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see where this is used. Should be in a separate module |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Copyright 2019 Camptocamp - Iryna Vyshnevska | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class Company(models.Model): | ||
_inherit = "res.company" | ||
|
||
use_oca_batch_validation = fields.Boolean() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the OCA way? This is not clear, help missing. Rename field |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,9 +12,3 @@ class ResConfigSettings(models.TransientModel): | |
related="company_id.use_oca_batch_validation", | ||
readonly=False, | ||
) | ||
|
||
|
||
class Company(models.Model): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Following conventions I've moved this class definition to a separate file. |
||
_inherit = "res.company" | ||
|
||
use_oca_batch_validation = fields.Boolean() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This migration script is needed to handle the return to an existent field
description_picking
from customdescription_warehouse
It was requested in TODO