diff --git a/addons/account/account.py b/addons/account/account.py index ef02e970a5f..b17de9add39 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -1762,6 +1762,11 @@ class wizard_multi_charts_accounts(osv.osv_memory): 'code_digits':fields.integer('# of Digits',required=True,help="No. of Digits to use for account code"), } + _defaults = { + 'company_id': lambda self, cr, uid, c: self.pool.get('res.users').browse(cr,uid,[uid],c)[0].company_id.id, + 'code_digits': lambda *a:6, + } + def action_create(self, cr, uid, ids, context=None): obj_multi = self.browse(cr,uid,ids[0]) obj_acc = self.pool.get('account.account') @@ -1887,9 +1892,9 @@ class wizard_multi_charts_accounts(osv.osv_memory): vals_journal['sequence_id']=seq_id #Sales Journal - vals_journal['name'] = 'Sales Journal '+ str(seq_code) + vals_journal['name'] = _('Sales Journal') vals_journal['type'] = 'sale' - vals_journal['code'] = 'SAJ' + str(seq_code) + vals_journal['code'] = _('SAJ') 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_receivable.id] @@ -1898,9 +1903,9 @@ class wizard_multi_charts_accounts(osv.osv_memory): obj_journal.create(cr,uid,vals_journal) # Purchase Journal - vals_journal['name']='Purchase Journal '+ str(seq_code) + vals_journal['name']=_('Purchase Journal') vals_journal['type']='purchase' - vals_journal['code']='EXJ' + str(seq_code) + vals_journal['code']=_('EXJ') 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_payable.id] @@ -1913,19 +1918,15 @@ class wizard_multi_charts_accounts(osv.osv_memory): view_id_cur = self.pool.get('account.journal.view').search(cr,uid,[('name','=','Multi-Currency Cash Journal View')])[0] ref_acc_bank = obj_multi.chart_template_id.bank_account_view_id - current_num = 0 + current_num = 1 for line in obj_multi.bank_accounts_id: #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 - code_main = len(ref_acc_bank.code+str(current_num)) - code_acc = ref_acc_bank.code+str(current_num) - if code_main<=dig: - code_acc=str(code_acc) + (str('0'*(dig-code_main))) 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': ref_acc_bank.code+str(current_num), + 'code': str(int(ref_acc_bank.code.ljust(dig,'0')) + current_num), 'type': 'other', 'user_type': account_template.user_type and account_template.user_type.id or False, 'reconcile': True, @@ -1935,8 +1936,8 @@ class wizard_multi_charts_accounts(osv.osv_memory): acc_cash_id = obj_acc.create(cr,uid,vals) #create the bank journal - vals_journal['name']='Bank Journal '+ str(current_num) - vals_journal['code']='BNK' + str(current_num) + vals_journal['name']= vals['name'] + vals_journal['code']= _('BNK') + str(current_num) vals_journal['sequence_id'] = seq_id vals_journal['type'] = 'cash' if line.currency_id: diff --git a/addons/account_payment/payment.py b/addons/account_payment/payment.py index c56116aaeab..7b110f8635a 100644 --- a/addons/account_payment/payment.py +++ b/addons/account_payment/payment.py @@ -391,8 +391,8 @@ class payment_line(osv.osv): # help='Amount to pay in the partner currency'), # 'currency': fields.function(_currency, string='Currency', # method=True, type='many2one', obj='res.currency'), - 'currency': fields.many2one('res.currency','Currency',required=True), - 'company_currency': fields.many2one('res.currency','Currency',readonly=True), + 'currency': fields.many2one('res.currency','Partner Currency',required=True), + 'company_currency': fields.many2one('res.currency','Company Currency',readonly=True), 'bank_id': fields.many2one('res.partner.bank', 'Destination Bank account'), 'order_id': fields.many2one('payment.order', 'Order', required=True, ondelete='cascade', select=True), @@ -432,17 +432,23 @@ class payment_line(osv.osv): def onchange_move_line(self,cr,uid,ids,move_line_id,payment_type,date_prefered,date_planned,currency=False,company_currency=False,context=None): data={} - data['amount_currency']=data['currency']=data['communication']=data['partner_id']=data['reference']=data['date_created']=data['bank_id']=data['amount']=False + + data['amount_currency']=data['communication']=data['partner_id']=data['reference']=data['date_created']=data['bank_id']=data['amount']=False + if move_line_id: line = self.pool.get('account.move.line').browse(cr,uid,move_line_id) data['amount_currency']=line.amount_to_pay - res = self.onchange_amount(cr, uid, ids, data['amount_currency'], currency, company_currency, context) + res = self.onchange_amount(cr, uid, ids, data['amount_currency'], currency, company_currency, if res: data['amount'] = res['value']['amount'] data['partner_id']=line.partner_id.id - data['currency']=line.currency_id and line.currency_id.id or False - if not data['currency']: - data['currency']=line.invoice and line.invoice.currency_id.id or False + temp = line.currency_id and line.currency_id.id or False + if not temp: + if line.invoice: + data['currency'] = line.invoice.currency_id.id + else: + data['currency'] = temp + # calling onchange of partner and updating data dictionary temp_dict=self.onchange_partner(cr,uid,ids,line.partner_id.id,payment_type) data.update(temp_dict['value']) diff --git a/addons/account_payment/payment_view.xml b/addons/account_payment/payment_view.xml index d77c454a90c..bba56a6d7ca 100644 --- a/addons/account_payment/payment_view.xml +++ b/addons/account_payment/payment_view.xml @@ -3,6 +3,18 @@ + + account.move.line.form.inherit + account.move.line + form + + + + + + + + account.move.line.tree account.move.line @@ -17,6 +29,7 @@ + @@ -88,8 +101,7 @@
- - + @@ -102,7 +114,6 @@ - @@ -115,34 +126,23 @@ - -
- + - + - - - + - - - - +
@@ -167,7 +167,6 @@ - @@ -212,9 +211,7 @@ - - - + @@ -222,7 +219,7 @@ - + @@ -238,18 +235,12 @@ - - - - - @@ -261,30 +252,19 @@ tree - + - - - - + - - - - -
diff --git a/addons/l10n_be/account_pcmn_belgium.xml b/addons/l10n_be/account_pcmn_belgium.xml index 2104baf6670..d7252313333 100644 --- a/addons/l10n_be/account_pcmn_belgium.xml +++ b/addons/l10n_be/account_pcmn_belgium.xml @@ -6615,7 +6615,7 @@ - Template of the belgian Chart of Accounts + Belgian PCMN diff --git a/addons/process/process.py b/addons/process/process.py index a89b6a6caaa..74b0d6fc036 100644 --- a/addons/process/process.py +++ b/addons/process/process.py @@ -59,12 +59,13 @@ class process_process(osv.osv): data['menu'] = (node.menu_id or None) and node.menu_id.name data['model'] = (node.model_id or None) and node.model_id.model data['kind'] = node.kind + data['notes'] = node.note data['active'] = 0 if node.kind == "state" and node.model_id and node.model_id.model == res_model: states = node.model_states states = (states or []) and states.split(',') - data['active'] = (states and current_object.state in states) or not states + data['active'] = not states or current_object.state in states elif node.kind == "router": #TODO: @@ -83,10 +84,13 @@ class process_process(osv.osv): data['name'] = tr.name data['source'] = tr.source_node_id.id data['target'] = tr.target_node_id.id + data['notes'] = tr.note data['buttons'] = buttons = [] for b in tr.action_ids: button = {} button['name'] = b.name + button['state'] = b.state + button['action'] = b.action buttons.append(button) data['roles'] = roles = [] for r in tr.transition_ids: