From 71e037395e537392082fe883d65079011feb6fef Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 27 Feb 2017 14:11:58 +0100 Subject: [PATCH] [MIG] module onchange_helper to v10.0 --- onchange_helper/README.rst | 8 ++------ onchange_helper/__init__.py | 3 +-- onchange_helper/__manifest__.py | 14 ++++++++++++++ onchange_helper/__openerp__.py | 15 --------------- onchange_helper/models/__init__.py | 3 +-- onchange_helper/models/ir_rule.py | 10 ++++++---- 6 files changed, 24 insertions(+), 29 deletions(-) create mode 100644 onchange_helper/__manifest__.py delete mode 100644 onchange_helper/__openerp__.py diff --git a/onchange_helper/README.rst b/onchange_helper/README.rst index 3af53e567..48cca771e 100644 --- a/onchange_helper/README.rst +++ b/onchange_helper/README.rst @@ -6,7 +6,7 @@ Onchange Helper =============== -This is a technical module. Its goal is to ease the play of onchange method directly called from python file. +This is a technical module. Its goal is to ease the play of onchange method directly called from Python code. Usage ===== @@ -20,14 +20,10 @@ Example if you want to create a sale order and you want to get the values relati `vals = {'partner_id: 1'}` - `vals = self.env['sale.order'].play_onchange(vals, ['partner_id'])` + `vals = self.env['sale.order'].play_onchanges(vals, ['partner_id'])` Then, `vals` will be updated with partner_invoice_id, partner_shipping_id, pricelist_id, etc... -For further information, please visit: - -* https://www.odoo.com/forum/help-1 - Bug Tracker =========== diff --git a/onchange_helper/__init__.py b/onchange_helper/__init__.py index 8d0394448..cde864bae 100644 --- a/onchange_helper/__init__.py +++ b/onchange_helper/__init__.py @@ -1,4 +1,3 @@ # -*- coding: utf-8 -*- -# © 2016 Akretion (http://www.akretion.com) -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + from . import models diff --git a/onchange_helper/__manifest__.py b/onchange_helper/__manifest__.py new file mode 100644 index 000000000..0d1b9b6a1 --- /dev/null +++ b/onchange_helper/__manifest__.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +# © 2016-2017 Akretion (http://www.akretion.com) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +{'name': 'Onchange Helper', + 'version': '10.0.1.0.0', + 'summary': 'Technical module that ease execution of onchange in Python code', + 'author': 'Akretion,Camptocamp,Odoo Community Association (OCA)', + 'website': 'http://www.akretion.com', + 'license': 'AGPL-3', + 'category': 'Generic Modules', + 'depends': ['base'], + 'installable': True, + } diff --git a/onchange_helper/__openerp__.py b/onchange_helper/__openerp__.py deleted file mode 100644 index abf6e1e85..000000000 --- a/onchange_helper/__openerp__.py +++ /dev/null @@ -1,15 +0,0 @@ -# -*- coding: utf-8 -*- -# © 2016 Akretion (http://www.akretion.com) -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). - -{'name': 'Onchange Helper', - 'version': '9.0.1.0.0', - 'author': 'Akretion,Camp2camp,Odoo Community Association (OCA)', - 'website': 'www.akretion.com', - 'license': 'AGPL-3', - 'category': 'Generic Modules', - 'depends': [ - 'base', - ], - 'installable': True, - } diff --git a/onchange_helper/models/__init__.py b/onchange_helper/models/__init__.py index 25bec87f2..0f0f860f3 100644 --- a/onchange_helper/models/__init__.py +++ b/onchange_helper/models/__init__.py @@ -1,4 +1,3 @@ # -*- coding: utf-8 -*- -# © 2016 Akretion (http://www.akretion.com) -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + from . import ir_rule diff --git a/onchange_helper/models/ir_rule.py b/onchange_helper/models/ir_rule.py index ec751bc28..4a20ef0dc 100644 --- a/onchange_helper/models/ir_rule.py +++ b/onchange_helper/models/ir_rule.py @@ -1,7 +1,9 @@ # -*- coding: utf-8 -*- -# © 2016 Akretion (http://www.akretion.com) +# © 2016-2017 Akretion (http://www.akretion.com) +# © 2016-2017 Camptocamp (http://www.camptocamp.com/) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import api, models + +from odoo import api, models def get_new_values(model, record, on_change_result): @@ -44,7 +46,7 @@ def play_onchanges(self, values, onchange_fields): class IrRule(models.Model): _inherit = 'ir.rule' - def _setup_complete(self, cr, uid): + def _setup_complete(self): if not hasattr(models.BaseModel, 'play_onchanges'): setattr(models.BaseModel, 'play_onchanges', play_onchanges) - return super(IrRule, self)._setup_complete(cr, uid) + return super(IrRule, self)._setup_complete()