diff --git a/__manifest__.py b/__manifest__.py index 2d05fee4d66553f71310b99966826a2d859cea47..5436c6d630de627f62adacd3729eaa2e16a7b410 100755 --- a/__manifest__.py +++ b/__manifest__.py @@ -1,7 +1,7 @@ { "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" ] } diff --git a/migrations/13.0.1.0.1/post-migration.py b/migrations/13.0.1.0.1/post-migration.py new file mode 100644 index 0000000000000000000000000000000000000000..24027b5157538d82c4e0b7776319d1f382be4170 --- /dev/null +++ b/migrations/13.0.1.0.1/post-migration.py @@ -0,0 +1,19 @@ +# 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) diff --git a/models/__init__.py b/models/__init__.py index 353259fb96becf235c2f99eed150f8f67804cd88..9c0a42138541a80d1b3357b67df7cb0e47e94b56 100644 --- a/models/__init__.py +++ b/models/__init__.py @@ -1,4 +1 @@ -# © 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 diff --git a/models/account_invoice.py b/models/account_move.py similarity index 89% rename from models/account_invoice.py rename to models/account_move.py index 55906295017030791d0b30f90261e6fa6e216358..20ebb028a09dbc390f3482c9b69935344cea9a53 100644 --- a/models/account_invoice.py +++ b/models/account_move.py @@ -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)