[MIG] base_usability: Migration to 12.0

This commit is contained in:
Raphaël Valyi
2018-12-25 15:29:56 -02:00
parent 04b91380a4
commit b78e1f50dc
9 changed files with 33 additions and 59 deletions

View File

@@ -1,22 +1,19 @@
# -*- coding: utf-8 -*-
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, api
from odoo.report import report_sxw
from openerp.tools import float_compare
from odoo.tools import misc
from odoo.tools import float_compare
class BaseUsabilityInstalled(models.AbstractModel):
_name = "base.usability.installed"
formatLang_original = report_sxw.rml_parse.formatLang
formatLang_original = misc.formatLang
def formatLang(
self, value, digits=None, date=False, date_time=False, grouping=True,
monetary=False, dp=False, currency_obj=False, int_no_digits=True):
def formatLang(self, value, digits=None, grouping=True, monetary=False,
dp=False, currency_obj=False, int_no_digits=True):
with api.Environment.manage():
env = api.Environment(self.cr, self.uid, {})
if (
@@ -30,9 +27,9 @@ def formatLang(
digits = 0
dp = False
res = formatLang_original(
self, value, digits=digits, date=date, date_time=date_time,
grouping=grouping, monetary=monetary, dp=dp, currency_obj=currency_obj)
self, value, digits=digits, grouping=grouping, monetary=monetary,
dp=dp, currency_obj=currency_obj)
return res
report_sxw.rml_parse.formatLang = formatLang
misc.formatLang = formatLang