[FIX] base_comment_template: Make field truly company dependent
Previous field declaration was incorrect due to a typo, leading to non applying the company dependent features. Now everything is correct and the migration scripts care of moving data properly.pull/646/head
parent
f67f8bbec8
commit
78d335f033
|
@ -4,7 +4,7 @@
|
||||||
{
|
{
|
||||||
"name": "Base Comments Templates",
|
"name": "Base Comments Templates",
|
||||||
"summary": "Comments templates on documents",
|
"summary": "Comments templates on documents",
|
||||||
"version": "12.0.2.0.0",
|
"version": "12.0.3.0.0",
|
||||||
"category": "Sale",
|
"category": "Sale",
|
||||||
"website": "https://github.com/OCA/account-invoice-reporting",
|
"website": "https://github.com/OCA/account-invoice-reporting",
|
||||||
"author": "Camptocamp, Odoo Community Association (OCA)",
|
"author": "Camptocamp, Odoo Community Association (OCA)",
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
# Copyright 2020 Tecnativa - Pedro M. Baeza
|
||||||
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||||
|
from openupgradelib import openupgrade
|
||||||
|
|
||||||
|
|
||||||
|
@openupgrade.migrate()
|
||||||
|
def migrate(env, version):
|
||||||
|
table = 'res_partner'
|
||||||
|
old_column = 'property_comment_template_id'
|
||||||
|
new_column = openupgrade.get_legacy_name(old_column)
|
||||||
|
if openupgrade.column_exists(cr, table, new_column):
|
||||||
|
openupgrade.convert_to_company_dependent(
|
||||||
|
env, 'res.partner', old_column, new_column, 'res.partner')
|
|
@ -0,0 +1,13 @@
|
||||||
|
# Copyright 2020 Tecnativa - Pedro M. Baeza
|
||||||
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||||
|
from openupgradelib import openupgrade
|
||||||
|
|
||||||
|
|
||||||
|
@openupgrade.migrate()
|
||||||
|
def migrate(env, version):
|
||||||
|
cr = env.cr
|
||||||
|
table = 'res_partner'
|
||||||
|
old_column = 'property_comment_template_id'
|
||||||
|
new_column = openupgrade.get_legacy_name(old_column)
|
||||||
|
if openupgrade.column_exists(cr, table, old_column):
|
||||||
|
openupgrade.rename_columns(cr, {table: [(old_column, new_column)]})
|
|
@ -9,7 +9,7 @@ class ResPartner(models.Model):
|
||||||
property_comment_template_id = fields.Many2one(
|
property_comment_template_id = fields.Many2one(
|
||||||
comodel_name='base.comment.template',
|
comodel_name='base.comment.template',
|
||||||
string='Conditions template',
|
string='Conditions template',
|
||||||
company_dependant=True,
|
company_dependent=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
|
|
Loading…
Reference in New Issue