summaryrefslogtreecommitdiff
path: root/addons/l10n_br/models
diff options
context:
space:
mode:
authorRohan Patel <rop@odoo.com>2016-05-24 11:55:16 +0530
committerYannick Tivisse <yti@odoo.com>2016-07-06 11:01:26 +0200
commitad7ca14d1b8efb5c1a4d574012bb2492914fb446 (patch)
tree12d4be9df9349160a0389508de7619c5c32a6385 /addons/l10n_br/models
parent180126755e7969559f719d6f445f0c4414dfcaad (diff)
[MIG] l10n_* : Migrated to new API
[MIG] l10n_ae : Migrated to new API. [MIG] l10n_ar : Migrated to new API. [MIG] l10n_at : Migrated to new API. [MIG] l10n_au : Migrated to new API. [MIG] l10n_be : Migrated to new API. [MIG] l10n_bo : Migrated to new API. [MIG] l10n_br : Migrated to new API. [MIG] l10n_ca : Migrated to new API. [MIG] l10n_ch : Migrated to new API. [MIG] l10n_cl : Migrated to new API. [MIG] l10n_cn : Migrated to new API. [MIG] l10n_co : Migrated to new API. [MIG] l10n_cr : Migrated to new API. [MIG] l10n_de : Migrated to new API. [MIG] l10n_de_skr03 : Migrated to new API. [MIG] l10n_de_skr04 : Migrated to new API. [MIG] l10n_cn_small_business : Migrated to new API. [MIG] l10n_cn_standard : Migrated to new API. [MIG] l10n_do : Migrated to new API. [MIG] l10n_ec : Migrated to new API. [MIG] l10n_es : Migrated to new API. [MIG] l10n_et : Migrated to new API. [MIG] l10n_fr : Migrated to new API. [MIG] l10n_generic_coa : Migrated to new API. [MIG] l10n_gr : Migrated to new API. [MIG] l10n_gt : Migrated to new API. [MIG] l10n_hn : Migrated to new API. [MIG] l10n_hr : Migrated to new API. [MIG] l10n_hu : Migrated to new API. [MIG] l10n_in : Migrated to new API. [MIG] l10n_it : Migrated to new API. [MIG] l10n_jp : Migrated to new API. [MIG] l10n_lu : Migrated to new API. [MIG] l10n_ma : Migrated to new API. [MIG] l10n_mx : Migrated to new API. [MIG] l10n_nl : Migrated to new API. [MIG] l10n_no : Migrated to new API. [MIG] l10n_nz : Migrated to new API. [MIG] l10n_pa : Migrated to new API. [MIG] l10n_pe : Migrated to new API. [MIG] l10n_pl : Migrated to new API. [MIG] l10n_ro : Migrated to new API. [MIG] l10n_sa : Migrated to new API. [MIG] l10n_sg : Migrated to new API. [MIG] l10n_si : Migrated to new API. [MIG] l10n_syscohada : Migrated to new API. [MIG] l10n_th : Migrated to new API. [MIG] l10n_tr : Migrated to new API. [MIG] l10n_uk : Migrated to new API. [MIG] l10n_us : Migrated to new API. [MIG] l10n_uy : Migrated to new API. [MIG] l10n_ve : Migrated to new API. [MIG] l10n_vn : Migrated to new API.
Diffstat (limited to 'addons/l10n_br/models')
-rw-r--r--addons/l10n_br/models/__init__.py2
-rw-r--r--addons/l10n_br/models/account.py71
2 files changed, 29 insertions, 44 deletions
diff --git a/addons/l10n_br/models/__init__.py b/addons/l10n_br/models/__init__.py
index 6cfaaa7a3ae..e29eb0b071d 100644
--- a/addons/l10n_br/models/__init__.py
+++ b/addons/l10n_br/models/__init__.py
@@ -1,4 +1,4 @@
-# -*- encoding: utf-8 -*-
+# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# Copyright (C) 2009 Renato Lima - Akretion
diff --git a/addons/l10n_br/models/account.py b/addons/l10n_br/models/account.py
index e9f3111f742..b88cd4465e0 100644
--- a/addons/l10n_br/models/account.py
+++ b/addons/l10n_br/models/account.py
@@ -1,53 +1,38 @@
-# -*- encoding: utf-8 -*-
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
-import openerp
-from openerp.osv import fields, osv
+from odoo import fields, models
-TAX_DEFAULTS = {
- 'base_reduction': 0,
- 'amount_mva': 0,
- 'amount_type': 'percent',
- }
-
-class account_tax_template(osv.osv):
+class AccountTaxTemplate(models.Model):
""" Add fields used to define some brazilian taxes """
_inherit = 'account.tax.template'
- _columns = {
- 'tax_discount': fields.boolean('Discount this Tax in Prince',
- help="Mark it for (ICMS, PIS e etc.)."),
- 'base_reduction': fields.float('Redution', required=True,
- digits=0,
- help="Um percentual decimal em % entre 0-1."),
- 'amount_mva': fields.float('MVA Percent', required=True,
- digits=0,
- help="Um percentual decimal em % entre 0-1."),
- 'amount_type': fields.selection([('group', 'Group of Taxes'),
- ('fixed', 'Fixed'),
- ('percent', 'Percentage of Price'),
- ('division', 'Percentage of Price Tax Included')],
- string="Tax Computation", required=True)
- }
- _defaults = TAX_DEFAULTS
+ tax_discount = fields.Boolean(string='Discount this Tax in Prince',
+ help="Mark it for (ICMS, PIS e etc.).")
+ base_reduction = fields.Float(string='Redution', digits=0, required=True,
+ help="Um percentual decimal em % entre 0-1.", default=0)
+ amount_mva = fields.Float(string='MVA Percent', digits=0, required=True,
+ help="Um percentual decimal em % entre 0-1.", default=0)
+ amount_type = fields.Selection([('group', 'Group of Taxes'),
+ ('fixed', 'Fixed'),
+ ('percent', 'Percentage of Price'),
+ ('division', 'Percentage of Price Tax Included')],
+ string='Tax Computation', required=True, default='percent')
+
-class account_tax(osv.osv):
+class AccountTax(models.Model):
""" Add fields used to define some brazilian taxes """
_inherit = 'account.tax'
- _columns = {
- 'tax_discount': fields.boolean('Discount this Tax in Prince',
- help="Mark it for (ICMS, PIS e etc.)."),
- 'base_reduction': fields.float('Redution', required=True,
- digits=0,
- help="Um percentual decimal em % entre 0-1."),
- 'amount_mva': fields.float('MVA Percent', required=True,
- digits=0,
- help="Um percentual decimal em % entre 0-1."),
- 'amount_type': fields.selection([('group', 'Group of Taxes'),
- ('fixed', 'Fixed'),
- ('percent', 'Percentage of Price'),
- ('division', 'Percentage of Price Tax Included')],
- string="Tax Computation", required=True)
- }
- _defaults = TAX_DEFAULTS
+ tax_discount = fields.Boolean(string='Discount this Tax in Prince',
+ help="Mark it for (ICMS, PIS e etc.).")
+ base_reduction = fields.Float(string='Redution', digits=0, required=True,
+ help="Um percentual decimal em % entre 0-1.", default=0)
+ amount_mva = fields.Float(string='MVA Percent', digits=0, required=True,
+ help="Um percentual decimal em % entre 0-1.", default=0)
+ amount_type = fields.Selection([('group', 'Group of Taxes'),
+ ('fixed', 'Fixed'),
+ ('percent', 'Percentage of Price'),
+ ('division', 'Percentage of Price Tax Included')],
+ string='Tax Computation', required=True, default='percent')