diff --git a/addons/account/account.py b/addons/account/account.py index 3abd1dba93b..f51f41e845c 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -21,6 +21,7 @@ ############################################################################## import time import netsvc + from osv import fields, osv from tools.misc import currency @@ -1175,8 +1176,10 @@ class account_tax_code(osv.osv): 'line_ids': fields.one2many('account.move.line', 'tax_code_id', 'Lines'), 'company_id': fields.many2one('res.company', 'Company', required=True), 'sign': fields.float('Sign for parent', required=True), + 'notprintable':fields.boolean("Not Printable in Invoice", help="Check this box if you don't want that any vat related to this Tax Code appears on invoices"), } + def name_get(self, cr, uid, ids, context=None): if not len(ids): return [] @@ -1194,6 +1197,7 @@ class account_tax_code(osv.osv): _defaults = { 'company_id': _default_company, 'sign': lambda *args: 1.0, + 'notprintable': lambda *a: False, } def _check_recursion(self, cr, uid, ids): level = 100 @@ -1262,8 +1266,18 @@ class account_tax(osv.osv): 'include_base_amount': fields.boolean('Include in base amount', help="Indicate 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 is the price you use on the product and invoices is including this tax.") + 'price_include': fields.boolean('Tax Included in Price', help="Check this is the price you use on the product and invoices is including this tax."), + 'type_tax_use': fields.selection([('sale','Sale'),('purchase','Purchase')], 'Tax Use in') + } + def search(self, cr, uid, args, offset=0, limit=None, order=None, + context=None, count=False): + if context and context.has_key('type'): + if context['type'] in ('out_invoice','out_refund'): + args.append(('type_tax_use','=','sale')) + elif context['type'] in ('in_invoice','in_refund'): + args.append(('type_tax_use','=','purchase')) + return super(account_tax, self).search(cr, uid, args, offset, limit, order, context, count) def name_get(self, cr, uid, ids, context={}): if not len(ids): @@ -1802,10 +1816,12 @@ class account_tax_code_template(osv.osv): 'parent_id': fields.many2one('account.tax.code.template', 'Parent Code', select=True), 'child_ids': fields.one2many('account.tax.code.template', 'parent_id', 'Childs Codes'), 'sign': fields.float('Sign for parent', required=True), + 'notprintable':fields.boolean("Not Printable in Invoice", help="Check this box if you don't want that any vat related to this Tax Code appears on invoices"), } _defaults = { 'sign': lambda *args: 1.0, + 'notprintable': lambda *a: False, } def name_get(self, cr, uid, ids, context=None): @@ -1892,6 +1908,7 @@ class account_tax_template(osv.osv): 'ref_tax_sign': fields.float('Tax Code Sign', help="Usually 1 or -1."), 'include_base_amount': fields.boolean('Include in base amount', help="Indicate if the amount of tax must be included in the base amount for the computation of the next taxes."), 'description': fields.char('Internal Name', size=32), + 'type_tax_use': fields.selection([('sale','Sale'),('purchase','Purchase')], 'Tax Use in') } def name_get(self, cr, uid, ids, context={}): @@ -1990,6 +2007,7 @@ class wizard_multi_charts_accounts(osv.osv_memory): 'chart_template_id': fields.many2one('account.chart.template','Chart Template',required=True), 'bank_accounts_id': fields.one2many('account.bank.accounts.wizard', 'bank_account_id', 'Bank Accounts',required=True), 'code_digits':fields.integer('# of Digits',required=True,help="No. of Digits to use for account code"), + 'seq_journal':fields.boolean('Separated Journal Sequences',help="Check this box if you want to use a different sequence for each created journal. Otherwise, all will use the same sequence."), } def _get_chart(self, cr, uid, context={}): @@ -2008,6 +2026,7 @@ class wizard_multi_charts_accounts(osv.osv_memory): obj_acc = self.pool.get('account.account') obj_acc_tax = self.pool.get('account.tax') obj_journal = self.pool.get('account.journal') + obj_sequence = self.pool.get('ir.sequence') obj_acc_template = self.pool.get('account.account.template') obj_fiscal_position_template = self.pool.get('account.fiscal.position.template') obj_fiscal_position = self.pool.get('account.fiscal.position') @@ -2065,6 +2084,7 @@ class wizard_multi_charts_accounts(osv.osv_memory): 'include_base_amount': tax.include_base_amount, 'description':tax.description, 'company_id': company_id, + 'type_tax_use': tax.type_tax_use } new_tax = obj_acc_tax.create(cr,uid,vals_tax) #as the accounts have not been created yet, we have to wait before filling these fields @@ -2120,16 +2140,22 @@ class wizard_multi_charts_accounts(osv.osv_memory): # Creating Journals vals_journal={} view_id = self.pool.get('account.journal.view').search(cr,uid,[('name','=','Journal View')])[0] - seq_id = self.pool.get('ir.sequence').search(cr,uid,[('code','=','account.journal')])[0] - seq_code = self.pool.get('ir.sequence').get(cr, uid, 'account.journal') + seq_id = obj_sequence.search(cr,uid,[('name','=','Account Journal')])[0] + + if obj_multi.seq_journal: + seq_id_sale = obj_sequence.search(cr,uid,[('name','=','Sale Journal')])[0] + seq_id_purchase = obj_sequence.search(cr,uid,[('name','=','Purchase Journal')])[0] + else: + seq_id_sale = seq_id + seq_id_purchase = seq_id - vals_journal['view_id']=view_id - vals_journal['sequence_id']=seq_id + vals_journal['view_id'] = view_id #Sales Journal vals_journal['name'] = _('Sales Journal') vals_journal['type'] = 'sale' vals_journal['code'] = _('SAJ') + vals_journal['sequence_id'] = seq_id_sale if obj_multi.chart_template_id.property_account_receivable: vals_journal['default_credit_account_id'] = acc_template_ref[obj_multi.chart_template_id.property_account_income_categ.id] @@ -2138,9 +2164,10 @@ class wizard_multi_charts_accounts(osv.osv_memory): obj_journal.create(cr,uid,vals_journal) # Purchase Journal - vals_journal['name']=_('Purchase Journal') - vals_journal['type']='purchase' - vals_journal['code']=_('EXJ') + vals_journal['name'] = _('Purchase Journal') + vals_journal['type'] = 'purchase' + vals_journal['code'] = _('EXJ') + vals_journal['sequence_id'] = seq_id_purchase if obj_multi.chart_template_id.property_account_payable: vals_journal['default_credit_account_id'] = acc_template_ref[obj_multi.chart_template_id.property_account_expense_categ.id] @@ -2158,7 +2185,7 @@ class wizard_multi_charts_accounts(osv.osv_memory): #create the account_account for this bank journal tmp = self.pool.get('res.partner.bank').name_get(cr, uid, [line.acc_no.id])[0][1] dig = obj_multi.code_digits - vals={ + vals = { 'name': line.acc_no.bank and line.acc_no.bank.name+' '+tmp or tmp, 'currency_id': line.currency_id and line.currency_id.id or False, 'code': str(ref_acc_bank.code.ljust(dig,'0') + str(current_num)), @@ -2170,6 +2197,13 @@ class wizard_multi_charts_accounts(osv.osv_memory): } acc_cash_id = obj_acc.create(cr,uid,vals) + if obj_multi.seq_journal: + vals_seq={ + 'name': _('Bank Journal ') + vals['name'], + 'code': 'account.journal', + } + seq_id = obj_sequence.create(cr,uid,vals_seq) + #create the bank journal vals_journal['name']= vals['name'] vals_journal['code']= _('BNK') + str(current_num) @@ -2181,7 +2215,7 @@ class wizard_multi_charts_accounts(osv.osv_memory): else: vals_journal['view_id'] = view_id_cash vals_journal['default_credit_account_id'] = acc_cash_id - vals_journal['default_debit_account_id']= acc_cash_id + vals_journal['default_debit_account_id'] = acc_cash_id obj_journal.create(cr,uid,vals_journal) current_num += 1 diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index e04b7c74a99..c130803aa82 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -63,7 +63,7 @@ - + @@ -156,7 +156,7 @@ - + @@ -197,7 +197,7 @@ - + @@ -284,7 +284,7 @@ - + diff --git a/addons/account/account_report.xml b/addons/account/account_report.xml index d0cdd8d370c..3fe2e12a138 100644 --- a/addons/account/account_report.xml +++ b/addons/account/account_report.xml @@ -18,13 +18,6 @@ string="Invoices" attachment="(object.state in ('open','paid')) and ('INV'+(object.number or '').replace('/',''))" attachment_use="1"/> - diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 6c293dfc7b2..08bb4c15877 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -461,6 +461,7 @@ + @@ -539,8 +540,9 @@
- + + @@ -606,6 +608,7 @@ + @@ -1548,6 +1551,7 @@ + @@ -1659,7 +1663,8 @@ diff --git a/addons/l10n_be/account_pcmn_belgium.xml b/addons/l10n_be/account_pcmn_belgium.xml index 85a19681293..fc3baa0203e 100644 --- a/addons/l10n_be/account_pcmn_belgium.xml +++ b/addons/l10n_be/account_pcmn_belgium.xml @@ -6637,6 +6637,7 @@ + sale @@ -6645,6 +6646,7 @@ percent + purchase @@ -6653,6 +6655,7 @@ percent + sale @@ -6661,6 +6664,7 @@ percent + purchase @@ -6673,6 +6677,7 @@ + sale @@ -6680,6 +6685,7 @@ percent + purchase @@ -6693,6 +6699,8 @@ + purchase + @@ -6702,6 +6710,7 @@ percent + purchase @@ -6710,6 +6719,7 @@ percent + sale @@ -6721,6 +6731,7 @@ + purchase @@ -6732,6 +6743,7 @@ + purchase @@ -6743,6 +6755,7 @@ + purchase @@ -6751,6 +6764,7 @@ percent + sale @@ -6760,6 +6774,7 @@ + sale @@ -6771,6 +6786,7 @@ + sale @@ -6782,6 +6798,7 @@ + sale @@ -6791,6 +6808,7 @@ + sale @@ -6802,6 +6820,7 @@ + sale @@ -6813,6 +6832,7 @@ + sale diff --git a/addons/l10n_chart_uk_minimal/account_tax.xml b/addons/l10n_chart_uk_minimal/account_tax.xml index 51d5c3f349f..a030925f8fa 100755 --- a/addons/l10n_chart_uk_minimal/account_tax.xml +++ b/addons/l10n_chart_uk_minimal/account_tax.xml @@ -1,128 +1,128 @@ - + - + - + - + - + Plan Fees UK - + VAT Balance to Pay - + Input VAT - + Input VAT Rate S (15%) - + Input VAT Rate R (5%) - + - + Output VAT - + Output VAT Rate S (15%) - + Output VAT Rate R (5%) - + - + - + Tax Bases - + Taxable Purchases Base - + Taxable Purchases Rated S (15%) - + Taxable Purchases Rated R (5%) - + Taxable Purchases Rated Z (0%) - + Taxable Purchases Type X (Exempt) - + Taxable Purchases Type O (Out of scope) - + - + Base of Taxable Sales - + Taxable Sales Rated S (15%) - + Taxable Sales Rated R (5%) - + Taxable Sales Rated Z (0%) - + Taxable Sales Type X (Exempt) - + Taxable Sales Type O (Out of scope) - + - + UK Minimal Account Chart Template @@ -133,10 +133,10 @@ - + - + IVAT S @@ -148,8 +148,9 @@ + purchase - + IVAT R @@ -161,8 +162,9 @@ + purchase - + IVAT Z @@ -170,8 +172,9 @@ percent + purchase - + IVAT X @@ -179,8 +182,9 @@ percent + purchase - + IVAT O @@ -188,10 +192,11 @@ percent + purchase - + OVAT S @@ -203,8 +208,9 @@ + sale - + OVAT R @@ -216,8 +222,9 @@ + sale - + OVAT Z @@ -225,8 +232,9 @@ percent + sale - + OVAT X @@ -234,8 +242,9 @@ percent + sale - + OVAT O @@ -243,7 +252,8 @@ percent + sale - + \ No newline at end of file diff --git a/addons/mrp_repair/mrp_repair_view.xml b/addons/mrp_repair/mrp_repair_view.xml index 15dfd109b59..68754d1e789 100644 --- a/addons/mrp_repair/mrp_repair_view.xml +++ b/addons/mrp_repair/mrp_repair_view.xml @@ -1,7 +1,7 @@ - + mrp.repair.form mrp.repair @@ -26,25 +26,25 @@ -
+ - - - + + + - - + + - + - + @@ -52,7 +52,7 @@ - +
@@ -88,7 +88,7 @@