From 6c3d7bb4874a484307d74e64793f9b474ed15da8 Mon Sep 17 00:00:00 2001 From: "mra (Open ERP)" Date: Wed, 2 Jun 2010 15:54:50 +0530 Subject: [PATCH] account_tax_include: Reverted changes bzr revid: mra@tinyerp.com-20100602102450-dack5o9qchv3l7t8 --- addons/account/account.py | 20 +++++++------- addons/account/account_view.xml | 18 +++++++------ .../account_tax_include.py | 12 --------- .../account_tax_include_view.xml | 26 ------------------- 4 files changed, 21 insertions(+), 55 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index 3fb74401946..feb9fe49f14 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -183,7 +183,7 @@ class account_account(osv.osv): temp.append(x) ids2 += self._get_children_and_consol(cr, uid, temp, context) return ids2 - + def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False): if context is None: @@ -320,7 +320,7 @@ class account_account(osv.osv): level = obj.level + 1 res[account.id] = level return res - + _columns = { 'name': fields.char('Name', size=128, required=True, select=True), 'currency_id': fields.many2one('res.currency', 'Secondary Currency', help="Forces all moves for this account to have this secondary currency."), @@ -477,7 +477,7 @@ class account_account(osv.osv): def _check_moves(self, cr, uid, ids, method, context): line_obj = self.pool.get('account.move.line') account_ids = self.search(cr, uid, [('id', 'child_of', ids)]) - + if line_obj.search(cr, uid, [('account_id', 'in', account_ids)]): if method == 'write': raise osv.except_osv(_('Error !'), _('You cannot deactivate an account that contains account moves.')) @@ -511,7 +511,7 @@ class account_account(osv.osv): context = {} if 'active' in vals and not vals['active']: self._check_moves(cr, uid, ids, "write", context) - if 'type' in vals.keys(): + if 'type' in vals.keys(): self._check_allow_type_change(cr, uid, ids, vals['type'], context=context) return super(account_account, self).write(cr, uid, ids, vals, context=context) @@ -683,7 +683,7 @@ class account_fiscalyear(osv.osv): else: return False return ids[0] - + def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=80): if args is None: args = [] @@ -695,7 +695,7 @@ class account_fiscalyear(osv.osv): if not ids: ids = self.search(cr, user, [('name',operator,name)]+ args, limit=limit) return self.name_get(cr, user, ids, context=context) - + account_fiscalyear() class account_period(osv.osv): @@ -771,7 +771,7 @@ class account_period(osv.osv): cr.execute('update account_journal_period set state=%s where period_id=%s', (mode, id)) cr.execute('update account_period set state=%s where id=%s', (mode, id)) return True - + def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=80): if args is None: args = [] @@ -1375,7 +1375,7 @@ class account_tax_code(osv.osv): return False level -= 1 return True - + def copy(self, cr, uid, id, default=None, context=None): if default is None: @@ -1383,7 +1383,7 @@ class account_tax_code(osv.osv): default = default.copy() default.update({'line_ids': []}) return super(account_tax_code, self).copy(cr, uid, id, default, context) - + _constraints = [ (_check_recursion, 'Error ! You can not create recursive accounts.', ['parent_id']) ] @@ -1441,6 +1441,7 @@ class account_tax(osv.osv): 'include_base_amount': fields.boolean('Included in base amount', help="Indicates if the amount of tax must be included in the base amount for the computation of the next taxes"), 'company_id': fields.many2one('res.company', 'Company', required=True), 'description': fields.char('Tax Code',size=32), + 'price_include': fields.boolean('Tax Included in Price', help="Check this if the price you use on the product and invoices includes this tax."), 'type_tax_use': fields.selection([('sale','Sale'),('purchase','Purchase'),('all','All')], 'Tax Application', required=True) } @@ -1473,6 +1474,7 @@ class account_tax(osv.osv): 'applicable_type': lambda *a: 'true', 'type': lambda *a: 'percent', 'amount': lambda *a: 0, + 'price_include': lambda *a: 0, 'active': lambda *a: 1, 'type_tax_use': lambda *a: 'all', 'sequence': lambda *a: 1, diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 64811758701..a2729676fe3 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -283,32 +283,32 @@ - + - + - + - + - + - + - + @@ -623,6 +623,7 @@ + @@ -654,6 +655,7 @@