Skip to content
Snippets Groups Projects
Commit fe4e5cd7 authored by Rémi - Le Filament's avatar Rémi - Le Filament
Browse files

[MIG] migration scripts for keeping fields on account.move

parent 97216963
No related branches found
No related tags found
No related merge requests found
{
"name": "3A Dentaire - Account Invoice Online",
"summary": "Option de paiement en ligne",
"version": "12.0.1.0.1",
"version": "13.0.1.0.1",
"author": "Le Filament",
"license": "AGPL-3",
"application": False,
......@@ -11,7 +11,7 @@
"account_payment",
],
"data": [
"views/account_invoice.xml",
"templates/account_portal_templates.xml"
#"views/account_invoice.xml",
#"templates/account_portal_templates.xml"
]
}
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openupgradelib import openupgrade
def update_account_move_is_payment_online(cr):
openupgrade.logged_query(
cr, """
UPDATE account_move am
SET is_payment_online = ai.is_payment_online
FROM account_invoice ai
WHERE am.old_invoice_id = ai.id
"""
)
@openupgrade.migrate(use_env=True)
def migrate(env, version):
update_account_move_is_payment_online(env.cr)
# © 2020 Le Filament (<http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import account_invoice
from . import account_move
......@@ -5,6 +5,6 @@ from odoo import fields, models
class AccountInvoiceOnline(models.Model):
_inherit = 'account.invoice'
_inherit = 'account.move'
is_payment_online = fields.Boolean("Paiement en ligne", default=True)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment