[MIG] module onchange_helper to v10.0
parent
f51be88bcb
commit
e069d02355
|
@ -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
|
||||
===========
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
}
|
|
@ -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,
|
||||
}
|
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue