diff --git a/addons/account/account.py b/addons/account/account.py index ae506290ff3..0c1bfa62409 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -1701,6 +1701,11 @@ class account_tax(osv.osv): ids = self.search(cr, user, args, limit=limit, context=context) return self.name_get(cr, user, ids, context=context) + def write(self, cr, uid, ids, vals, context=None): + if vals.get('type', False) and vals['type'] in ('none', 'code'): + vals.update({'amount': 0.0}) + return super(account_tax, self).write(cr, uid, ids, vals, context=context) + def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False): journal_pool = self.pool.get('account.journal') @@ -1996,26 +2001,28 @@ class account_model(osv.osv): _columns = { 'name': fields.char('Model Name', size=64, required=True, help="This is a model for recurring accounting entries"), 'journal_id': fields.many2one('account.journal', 'Journal', required=True), - 'company_id': fields.many2one('res.company', 'Company', required=True), + 'company_id': fields.related('journal_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True), 'lines_id': fields.one2many('account.model.line', 'model_id', 'Model Entries'), 'legend' :fields.text('Legend', readonly=True, size=100), } _defaults = { 'legend': lambda self, cr, uid, context:_('You can specify year, month and date in the name of the model using the following labels:\n\n%(year)s : To Specify Year \n%(month)s : To Specify Month \n%(date)s : Current Date\n\ne.g. My model on %(date)s'), - 'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id, } - def generate(self, cr, uid, ids, datas={}, context={}): + def generate(self, cr, uid, ids, datas={}, context=None): move_ids = [] entry = {} account_move_obj = self.pool.get('account.move') account_move_line_obj = self.pool.get('account.move.line') pt_obj = self.pool.get('account.payment.term') - if datas.get('date', False): - context.update({'date':datas['date']}) - period_id = self.pool.get('account.period').find(cr, uid, dt=context.get('date', False)) + if context is None: + context = {} + if datas.get('date', False): + context.update({'date': datas['date']}) + + period_id = self.pool.get('account.period').find(cr, uid, dt=context.get('date', False)) if not period_id: raise osv.except_osv(_('No period found !'), _('Unable to find a valid period !')) period_id = period_id[0] @@ -2069,7 +2076,9 @@ class account_model(osv.osv): c = context.copy() c.update({'journal_id': model.journal_id.id,'period_id': period_id}) account_move_line_obj.create(cr, uid, val, context=c) + return move_ids + account_model() class account_model_line(osv.osv): diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index be26005f997..3a7b259ab0f 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -176,15 +176,15 @@ class account_bank_statement(osv.osv): } _defaults = { - 'name': lambda *a: "/", - 'date': lambda *a: time.strftime('%Y-%m-%d'), - 'state': lambda *a: 'draft', + 'name': "/", + 'date': time.strftime('%Y-%m-%d'), + 'state': 'draft', 'balance_start': _default_balance_start, 'journal_id': _default_journal_id, 'period_id': _get_period, } - def onchange_date(self, cr, user, ids, date, context={}): + def onchange_date(self, cr, user, ids, date, context=None): """ Returns a dict that contains new values and context @param cr: A database cursor @@ -196,6 +196,10 @@ class account_bank_statement(osv.osv): """ res = {} period_pool = self.pool.get('account.period') + + if context is None: + context = {} + pids = period_pool.search(cr, user, [('date_start','<=',date), ('date_stop','>=',date)]) if pids: res.update({ @@ -210,10 +214,8 @@ class account_bank_statement(osv.osv): 'context':context, } - def button_dummy(self, cr, uid, ids, context={}): - self.write(cr, uid, ids, {}, context) - return True - + def button_dummy(self, cr, uid, ids, context=None): + return self.write(cr, uid, ids, {}, context=context) def create_move_from_st_line(self, cr, uid, st_line_id, company_currency_id, st_line_number, context=None): res_currency_obj = self.pool.get('res.currency') @@ -348,7 +350,7 @@ class account_bank_statement(osv.osv): company_currency_id = st.journal_id.company_id.currency_id.id if not self.check_status_condition(cr, uid, st.state, journal_type=j_type): continue - + self.balance_check(cr, uid, st.id, journal_type=j_type, context=context) if (not st.journal_id.default_credit_account_id) \ or (not st.journal_id.default_debit_account_id): @@ -382,7 +384,7 @@ class account_bank_statement(osv.osv): done.append(st.id) return self.write(cr, uid, ids, {'state':'confirm'}, context=context) - def button_cancel(self, cr, uid, ids, context={}): + def button_cancel(self, cr, uid, ids, context=None): done = [] for st in self.browse(cr, uid, ids, context): if st.state=='draft': @@ -392,8 +394,7 @@ class account_bank_statement(osv.osv): ids += [x.id for x in line.move_ids] self.pool.get('account.move').unlink(cr, uid, ids, context) done.append(st.id) - self.write(cr, uid, done, {'state':'draft'}, context=context) - return True + return self.write(cr, uid, done, {'state':'draft'}, context=context) def onchange_journal_id(self, cursor, user, statement_id, journal_id, context=None): account_journal_obj = self.pool.get('account.journal') @@ -424,7 +425,7 @@ class account_bank_statement(osv.osv): context = {} default = default.copy() default['move_line_ids'] = [] - return super(account_bank_statement, self).copy(cr, uid, id, default, context) + return super(account_bank_statement, self).copy(cr, uid, id, default, context=context) account_bank_statement() @@ -496,8 +497,8 @@ class account_bank_statement_line(osv.osv): } _defaults = { 'name': lambda self,cr,uid,context={}: self.pool.get('ir.sequence').get(cr, uid, 'account.bank.statement.line'), - 'date': lambda *a: time.strftime('%Y-%m-%d'), - 'type': lambda *a: 'general', + 'date': time.strftime('%Y-%m-%d'), + 'type': 'general', } account_bank_statement_line() diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 89bdcf0bffe..6d3f63118e1 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -95,8 +95,8 @@ - - + + @@ -528,7 +528,7 @@ - +
@@ -537,7 +537,7 @@ - + @@ -849,7 +849,7 @@ - + diff --git a/addons/account/demo/account_minimal.xml b/addons/account/demo/account_minimal.xml index d925dfa02ed..764420e6689 100644 --- a/addons/account/demo/account_minimal.xml +++ b/addons/account/demo/account_minimal.xml @@ -348,6 +348,7 @@ + @@ -359,6 +360,7 @@ + @@ -370,6 +372,7 @@ + @@ -381,6 +384,7 @@ + @@ -392,6 +396,7 @@ + @@ -402,6 +407,7 @@ + @@ -412,6 +418,7 @@ + diff --git a/addons/account/installer.py b/addons/account/installer.py index 2f8c48ecebb..54e3956ff48 100644 --- a/addons/account/installer.py +++ b/addons/account/installer.py @@ -67,13 +67,13 @@ class account_installer(osv.osv_memory): 'company_id': fields.many2one('res.company', 'Company'), } - def _default_company(self, cr, uid, context={}): + def _default_company(self, cr, uid, context=None): user = self.pool.get('res.users').browse(cr, uid, uid, context=context) if user.company_id: return user.company_id.id return False - def _get_default_charts(self, cr, uid, context={}): + def _get_default_charts(self, cr, uid, context=None): module_name = False company_id = self._default_company(cr, uid, context=context) company = self.pool.get('res.company').browse(cr, uid, company_id) @@ -91,18 +91,18 @@ class account_installer(osv.osv_memory): _defaults = { 'date_start': lambda *a: time.strftime('%Y-01-01'), 'date_stop': lambda *a: time.strftime('%Y-12-31'), - 'period':lambda *a:'month', - 'sale_tax':lambda *a:0.0, - 'purchase_tax':lambda *a:0.0, + 'period': lambda *a:'month', + 'sale_tax': lambda *a:0.0, + 'purchase_tax': lambda *a:0.0, 'company_id': _default_company, - 'bank_accounts_id':_get_default_accounts, + 'bank_accounts_id': _get_default_accounts, 'charts': _get_default_charts } def on_change_tax(self, cr, uid, id, tax): return {'value':{'purchase_tax':tax}} - def on_change_start_date(self, cr, uid, id, start_date): + def on_change_start_date(self, cr, uid, id, start_date=False): if start_date: start_date = datetime.datetime.strptime(start_date, "%Y-%m-%d") end_date = (start_date + relativedelta(months=12)) - relativedelta(days=1) @@ -117,7 +117,6 @@ class account_installer(osv.osv_memory): 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') - data_pool = self.pool.get('ir.model.data') mod_obj = self.pool.get('ir.model.data') result = mod_obj._get_id(cr, uid, 'account', 'configurable_chart_template') @@ -211,7 +210,7 @@ class account_installer(osv.osv_memory): vals={ 'name': (obj_acc_root.id == account_template.id) and company_id.name or account_template.name, #'sign': account_template.sign, - #'currency_id': account_template.currency_id and account_template.currency_id.id or False, + 'currency_id': account_template.currency_id and account_template.currency_id.id or False, 'code': code_acc, 'type': account_template.type, 'user_type': account_template.user_type and account_template.user_type.id or False, @@ -237,7 +236,7 @@ class account_installer(osv.osv_memory): 'company_id': company_id.id, } bank_account = obj_acc.create(cr, uid, b_vals) - + view_id_cash = self.pool.get('account.journal.view').search(cr,uid,[('name','=','Bank/Cash Journal View')])[0] #why fixed name here? view_id_cur = self.pool.get('account.journal.view').search(cr,uid,[('name','=','Bank/Cash Journal (Multi-Currency) View')])[0] #Why Fixed name here? ref_acc_bank = obj_multi.bank_account_view_id @@ -262,11 +261,14 @@ class account_installer(osv.osv_memory): seq_id = obj_sequence.create(cr,uid,vals_seq) #create the bank journals + sit_res = mod_obj._get_id(cr, uid, 'account', 'sit') + sit_id = mod_obj.read(cr, uid, [sit_res], ['res_id'])[0]['res_id'] vals_journal = {} vals_journal['name']= _('Bank Journal ') vals_journal['code']= _('BNK') vals_journal['sequence_id'] = seq_id vals_journal['type'] = 'cash' + vals_journal['analytic_journal_id'] = sit_id if vals.get('currency_id', False): vals_journal['view_id'] = view_id_cur vals_journal['currency'] = vals.get('currency_id', False) @@ -321,6 +323,7 @@ class account_installer(osv.osv_memory): vals_journal['view_id'] = view_id_cash vals_journal['default_credit_account_id'] = child_bnk_acc vals_journal['default_debit_account_id'] = child_bnk_acc + vals_journal['analytic_journal_id'] = sit_id obj_journal.create(cr,uid,vals_journal) code_cnt += 1 @@ -366,10 +369,15 @@ class account_installer(osv.osv_memory): vals_journal['view_id'] = view_id #Sales Journal + result = mod_obj._get_id(cr, uid, 'account', 'cose_journal_sale') + sale_id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id'] + vals_journal['name'] = _('Sales Journal') vals_journal['type'] = 'sale' vals_journal['code'] = _('SAJ') vals_journal['sequence_id'] = seq_id_sale + vals_journal['analytic_journal_id'] = sale_id + if obj_multi.property_account_receivable: vals_journal['default_credit_account_id'] = acc_template_ref[obj_multi.property_account_income_categ.id] @@ -378,10 +386,14 @@ class account_installer(osv.osv_memory): obj_journal.create(cr,uid,vals_journal) # Purchase Journal + result = mod_obj._get_id(cr, uid, 'account', 'exp') + pur_id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id'] + vals_journal['name'] = _('Purchase Journal') vals_journal['type'] = 'purchase' vals_journal['code'] = _('EXJ') vals_journal['sequence_id'] = seq_id_purchase + vals_journal['analytic_journal_id'] = pur_id if obj_multi.property_account_payable: vals_journal['default_credit_account_id'] = acc_template_ref[obj_multi.property_account_expense_categ.id] @@ -406,6 +418,7 @@ class account_installer(osv.osv_memory): vals_journal['refund_journal'] = True vals_journal['code'] = _('SCNJ') vals_journal['sequence_id'] = seq_id_sale_refund + vals_journal['analytic_journal_id'] = sale_id if obj_multi.property_account_receivable: vals_journal['default_credit_account_id'] = acc_template_ref[obj_multi.property_account_income_categ.id] @@ -419,6 +432,7 @@ class account_installer(osv.osv_memory): vals_journal['refund_journal'] = True vals_journal['code'] = _('ECNJ') vals_journal['sequence_id'] = seq_id_purchase_refund + vals_journal['analytic_journal_id'] = pur_id if obj_multi.property_account_payable: vals_journal['default_credit_account_id'] = acc_template_ref[obj_multi.property_account_expense_categ.id] @@ -519,7 +533,7 @@ class account_installer(osv.osv_memory): p_tax = (res.get('purchase_tax',0.0))/100 tax_val = {} default_tax = [] - + pur_temp_tax = mod_obj._get_id(cr, uid, 'account', 'tax_code_base_purchases') pur_temp_tax_id = mod_obj.read(cr, uid, [pur_temp_tax], ['res_id'])[0]['res_id'] pur_temp_tax_names = obj_temp_tax_code.read(cr, uid, [pur_temp_tax_id], ['name']) @@ -529,7 +543,7 @@ class account_installer(osv.osv_memory): pur_taxcode_parent_id = pur_taxcode_parent_id[0] else: pur_taxcode_parent_id = False - + pur_temp_tax_paid = mod_obj._get_id(cr, uid, 'account', 'tax_code_input') pur_temp_tax_paid_id = mod_obj.read(cr, uid, [pur_temp_tax_paid], ['res_id'])[0]['res_id'] pur_temp_tax_paid_names = obj_temp_tax_code.read(cr, uid, [pur_temp_tax_paid_id], ['name']) @@ -539,7 +553,7 @@ class account_installer(osv.osv_memory): pur_taxcode_paid_parent_id = pur_taxcode_paid_parent_id[0] else: pur_taxcode_paid_parent_id = False - + sale_temp_tax = mod_obj._get_id(cr, uid, 'account', 'tax_code_base_sales') sale_temp_tax_id = mod_obj.read(cr, uid, [sale_temp_tax], ['res_id'])[0]['res_id'] sale_temp_tax_names = obj_temp_tax_code.read(cr, uid, [sale_temp_tax_id], ['name']) @@ -549,7 +563,7 @@ class account_installer(osv.osv_memory): sale_taxcode_parent_id = sale_taxcode_parent_id[0] else: sale_taxcode_parent_id = False - + sale_temp_tax_paid = mod_obj._get_id(cr, uid, 'account', 'tax_code_output') sale_temp_tax_paid_id = mod_obj.read(cr, uid, [sale_temp_tax_paid], ['res_id'])[0]['res_id'] sale_temp_tax_paid_names = obj_temp_tax_code.read(cr, uid, [sale_temp_tax_paid_id], ['name']) @@ -571,7 +585,7 @@ class account_installer(osv.osv_memory): 'parent_id': sale_taxcode_parent_id } new_tax_code = self.pool.get('account.tax.code').create(cr, uid, vals_tax_code) - + vals_paid_tax_code = { 'name': 'TAX Paid %s%%'%(s_tax*100), 'code': 'TAX Paid %s%%'%(s_tax*100), @@ -580,7 +594,7 @@ class account_installer(osv.osv_memory): 'parent_id': sale_taxcode_paid_parent_id } new_paid_tax_code = self.pool.get('account.tax.code').create(cr, uid, vals_paid_tax_code) - + sales_tax = obj_tax.create(cr, uid, {'name':'TAX%s%%'%(s_tax*100), 'description':'TAX%s%%'%(s_tax*100), @@ -601,13 +615,13 @@ class account_installer(osv.osv_memory): purchase_tax_account_id = tax_account_ids and tax_account_ids[0] or False vals_tax_code = { 'name': 'TAX%s%%'%(p_tax*100), - 'code': 'TAX%s%%'%(p_tax*100), + 'code': 'TAX%s%%'%(p_tax*100), 'company_id': company_id.id, 'sign': 1, 'parent_id': pur_taxcode_parent_id } new_tax_code = self.pool.get('account.tax.code').create(cr, uid, vals_tax_code) - + vals_paid_tax_code = { 'name': 'TAX Paid %s%%'%(p_tax*100), 'code': 'TAX Paid %s%%'%(p_tax*100), @@ -616,7 +630,7 @@ class account_installer(osv.osv_memory): 'parent_id': pur_taxcode_paid_parent_id } new_paid_tax_code = self.pool.get('account.tax.code').create(cr, uid, vals_paid_tax_code) - + purchase_tax = obj_tax.create(cr, uid, {'name':'TAX%s%%'%(p_tax*100), 'description':'TAX%s%%'%(p_tax*100), @@ -680,9 +694,9 @@ class account_bank_accounts_wizard(osv.osv_memory): 'currency_id': fields.many2one('res.currency', 'Secondary Currency', help="Forces all moves for this account to have this secondary currency."), 'account_type': fields.selection([('cash','Cash'),('check','Check'),('bank','Bank')], 'Account Type', size=32), } - _defaults = { - 'currency_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.currency_id.id, - } +# _defaults = { +# 'currency_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.currency_id.id, +# } account_bank_accounts_wizard() @@ -710,11 +724,12 @@ class account_installer_modules(osv.osv_memory): # 'account_voucher_payment':fields.boolean('Voucher and Reconcile Management', # help="Extension Account Voucher module includes allows to link payment / receipt " # "entries with voucher, also automatically reconcile during the payment and receipt entries."), - } + } _defaults = { 'account_voucher': True, - } + } + account_installer_modules() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account/project/project_demo.xml b/addons/account/project/project_demo.xml index a26d2e338c9..dcb894bc940 100644 --- a/addons/account/project/project_demo.xml +++ b/addons/account/project/project_demo.xml @@ -13,7 +13,7 @@ START - Starting Balance + Miscellaneous Operation situation diff --git a/addons/account/test/account_change_currency.yml b/addons/account/test/account_change_currency.yml index 71a4ff6e301..d68b5fb90b5 100644 --- a/addons/account/test/account_change_currency.yml +++ b/addons/account/test/account_change_currency.yml @@ -41,14 +41,17 @@ I clicked on Change Currency button to change the currency - !python {model: account.change.currency}: | - self.view_init(cr, uid, [ref("account_change_currency_0")], {"lang": 'en_US', - "active_model": "account.invoice", "tz": False, "record_id": 4, "active_ids": - [ref("account_invoice_currency")], "type": "out_invoice", "active_id": ref("account_invoice_currency"), - }) - self.change_currency(cr, uid, [ref("account_change_currency_0")], {"lang": 'en_US', - "active_model": "account.invoice", "tz": False, "record_id": 4, "active_ids": - [ref("account_invoice_currency")], "type": "out_invoice", "active_id": ref("account_invoice_currency"), - }) + try: + self.view_init(cr, uid, [ref("account_change_currency_0")], {"lang": 'en_US', + "active_model": "account.invoice", "tz": False, "record_id": 4, "active_ids": + [ref("account_invoice_currency")], "type": "out_invoice", "active_id": ref("account_invoice_currency"), + }) + self.change_currency(cr, uid, [ref("account_change_currency_0")], {"lang": 'en_US', + "active_model": "account.invoice", "tz": False, "record_id": 4, "active_ids": + [ref("account_invoice_currency")], "type": "out_invoice", "active_id": ref("account_invoice_currency"), + }) + except: + print "Error: You can change currency only for Draft Invoice !" - I can't change the currency of invoice when it is not in draft state so i change the state to cancel - diff --git a/addons/account/test/account_fiscalyear_close.yml b/addons/account/test/account_fiscalyear_close.yml index 59cbfdafc0b..b3a4eccf816 100644 --- a/addons/account/test/account_fiscalyear_close.yml +++ b/addons/account/test/account_fiscalyear_close.yml @@ -1,21 +1,21 @@ - - In order to test Generate Fiscalyear Opening Entries wizard of OpenERP I first create a fiscalyear "Fiscal Year 2011" to which the entries will move + In order to test Generate Fiscalyear Opening Entries wizard of OpenERP I first create a fiscalyear to which the entries will move - !record {model: account.fiscalyear, id: account_fiscalyear_fiscalyear0}: - code: FY2011 + code: !eval "'FY%s'% (datetime.now().year+1)" company_id: base.main_company - date_start: '2011-01-01' - date_stop: '2011-12-31' - name: Fiscal Year 2011 + date_start: !eval "'%s-01-01' %(datetime.now().year+1)" + date_stop: !eval "'%s-12-31' %(datetime.now().year+1)" + name: !eval "'Fiscal Year %s' %(datetime.now().year+1)" - - I create a period "Jan2011" for the new fiscalyear + I create a period for the month of january for the new fiscalyear - !record {model: account.period, id: account_period_jan11}: company_id: base.main_company - date_start: '2011-01-01' - date_stop: '2011-12-31' + date_start: !eval "'%s-01-01'% (datetime.now().year+1)" + date_stop: !eval "'%s-12-31'% (datetime.now().year+1)" fiscalyear_id: account_fiscalyear_fiscalyear0 - name: Jan2011 + name: !eval "'Jan%s' %(datetime.now().year+1)" special: 1 - @@ -90,7 +90,4 @@ # self.action_open_window(cr, uid, [ref("account_move_journal_2")], {"lang": 'en_US', # "active_model": "ir.ui.menu", "active_ids": [ref("account.menu_action_move_journal_line_form")], # "tz": False, "active_id": ref("account.menu_action_move_journal_line_form"), -# }) - - - +# }) \ No newline at end of file diff --git a/addons/account/test/account_fiscalyear_close_state.yml b/addons/account/test/account_fiscalyear_close_state.yml index 6d4d5353a19..af4d05eba76 100644 --- a/addons/account/test/account_fiscalyear_close_state.yml +++ b/addons/account/test/account_fiscalyear_close_state.yml @@ -3,11 +3,11 @@ In order to check the Close a Fiscal Year wizard in OpenERP I first create a Fiscalyear - !record {model: account.fiscalyear, id: account_fiscalyear_fiscalyear0}: - code: FY2011 + code: !eval "'FY%s'% (datetime.now().year+1)" company_id: base.main_company - date_start: '2011-01-01' - date_stop: '2011-12-31' - name: Fiscal Year 2011 + date_start: !eval "'%s-01-01' %(datetime.now().year+1)" + date_stop: !eval "'%s-12-31' %(datetime.now().year+1)" + name: !eval "'Fiscal Year %s' %(datetime.now().year+1)" - I create monthly Periods for this fiscalyear - diff --git a/addons/account_coda/account_coda_view.xml b/addons/account_coda/account_coda_view.xml index cff1b89ee4c..0654d8dc1cd 100644 --- a/addons/account_coda/account_coda_view.xml +++ b/addons/account_coda/account_coda_view.xml @@ -75,7 +75,7 @@ - - - - - - - - @@ -37,6 +30,13 @@ + + + + + + + @@ -63,13 +63,6 @@ - - - - - - - @@ -77,6 +70,13 @@ + + + + + + + @@ -151,7 +151,7 @@ - + - + Vendor Payment account.voucher @@ -331,7 +331,7 @@ - + Sales Payment account.voucher diff --git a/addons/account_voucher/voucher_sales_purchase_view.xml b/addons/account_voucher/voucher_sales_purchase_view.xml index b72faa46d46..576bf5fa5c7 100644 --- a/addons/account_voucher/voucher_sales_purchase_view.xml +++ b/addons/account_voucher/voucher_sales_purchase_view.xml @@ -22,13 +22,6 @@ - - - - - - - @@ -36,6 +29,13 @@ + + + + + + + @@ -61,13 +61,6 @@ - - - - - - - @@ -75,6 +68,13 @@ + + + + + + + @@ -122,7 +122,7 @@ - @@ -159,7 +159,7 @@ - + Sales Receipt @@ -205,7 +205,7 @@
- + @@ -284,8 +284,8 @@ - - + + diff --git a/addons/account_voucher/voucher_view.xml b/addons/account_voucher/voucher_view.xml index d785350b876..4b09fdc70e9 100644 --- a/addons/account_voucher/voucher_view.xml +++ b/addons/account_voucher/voucher_view.xml @@ -107,13 +107,6 @@ - - - - - - - @@ -121,6 +114,13 @@ + + + + + + + diff --git a/addons/analytic/analytic.py b/addons/analytic/analytic.py index eef25f665d8..b97edb9a546 100644 --- a/addons/analytic/analytic.py +++ b/addons/analytic/analytic.py @@ -35,16 +35,16 @@ class account_analytic_account(osv.osv): cr.execute("SELECT a.id, r.currency_id FROM account_analytic_account a INNER JOIN res_company r ON (a.company_id = r.id) where a.id IN %s" , (tuple(ids2),)) currency = dict(cr.fetchall()) res_currency= self.pool.get('res.currency') - for id in ids: - if id not in ids2: + for account in self.browse(cr, uid, ids, context=context): + if account.id not in ids2: continue - for child in self.search(cr, uid, [('parent_id', 'child_of', [id])]): - if child != id: - res.setdefault(id, 0.0) - if currency[child]!=currency[id]: - res[id] += res_currency.compute(cr, uid, currency[child], currency[id], res.get(child, 0.0), context=context) + for child in account.child_ids: + if child.id != account.id: + res.setdefault(account.id, 0.0) + if currency[child.id] != currency[account.id]: + res[account.id] += res_currency.compute(cr, uid, currency[child.id], currency[account.id], res.get(child.id, 0.0), context=context) else: - res[id] += res.get(child, 0.0) + res[account.id] += res.get(child.id, 0.0) cur_obj = res_currency.browse(cr, uid, currency.values(), context=context) cur_obj = dict([(o.id, o) for o in cur_obj]) @@ -145,13 +145,13 @@ class account_analytic_account(osv.osv): for account_id, sum in cr.fetchall(): res[account_id] = sum - for id in ids: - if id not in parent_ids: + for account in self.browse(cr, uid, ids, context=context): + if account.id not in parent_ids: continue - for child in self.search(cr, uid, [('parent_id', 'child_of', [id])]): - if child != id: - res.setdefault(id, 0.0) - res[id] += res.get(child, 0.0) + for child in account.child_ids: + if child.id != account.id: + res.setdefault(account.id, 0.0) + res[account.id] += res.get(child.id, 0.0) return dict([(i, res[i]) for i in ids]) def name_get(self, cr, uid, ids, context=None): diff --git a/addons/crm/crm_opportunity_view.xml b/addons/crm/crm_opportunity_view.xml index aaf344043d7..e816e3f0b1d 100644 --- a/addons/crm/crm_opportunity_view.xml +++ b/addons/crm/crm_opportunity_view.xml @@ -220,7 +220,6 @@ -