From 24e03ae890325d67794d844b1c5c2eb8d7389bff Mon Sep 17 00:00:00 2001 From: Amit Mendapara Date: Wed, 17 Sep 2008 19:07:18 +0530 Subject: [PATCH 1/5] process.graph_get returns more info bzr revid: ame@tinyerp.com-20080917133718-tync46ybwjup7cv6 --- addons/process/process.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/process/process.py b/addons/process/process.py index a89b6a6caaa..0a8be26995b 100644 --- a/addons/process/process.py +++ b/addons/process/process.py @@ -59,6 +59,7 @@ 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: @@ -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: From c0b8a50ba1b425d0574efcff7d749be2a1818e03 Mon Sep 17 00:00:00 2001 From: Amit Mendapara Date: Wed, 17 Sep 2008 19:53:44 +0530 Subject: [PATCH 2/5] Fixed process (active node). bzr revid: ame@tinyerp.com-20080917142344-s3opqj63azmm5jqg --- addons/process/process.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/process/process.py b/addons/process/process.py index 0a8be26995b..74b0d6fc036 100644 --- a/addons/process/process.py +++ b/addons/process/process.py @@ -65,7 +65,7 @@ class process_process(osv.osv): 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: From b8134ef1231d489262308ff87c336d36d7232cce Mon Sep 17 00:00:00 2001 From: qdp Date: Wed, 17 Sep 2008 16:56:30 +0200 Subject: [PATCH 3/5] *improvement bzr revid: qdp@tinyerp.com-20080917145630-53x61ke4py6tk53t --- addons/account/account.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index b47b4c14bd9..311b251ca46 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -1761,6 +1761,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') @@ -1886,9 +1891,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] @@ -1897,9 +1902,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] @@ -1912,19 +1917,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, @@ -1934,8 +1935,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: From cfb6ba7f158482f2e48bdecba952fa41b3248f85 Mon Sep 17 00:00:00 2001 From: qdp Date: Wed, 17 Sep 2008 16:57:37 +0200 Subject: [PATCH 4/5] *improvement and overall cleaning + better views bzr revid: qdp@tinyerp.com-20080917145737-p0t5r4wnc5eaae8h --- addons/account_payment/payment.py | 20 +++++--- addons/account_payment/payment_view.xml | 64 +++++++++---------------- 2 files changed, 35 insertions(+), 49 deletions(-) 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 - + - - - - + - - - - -
From 9c4966f96115a72c48df0cbf94698d00fea54b0f Mon Sep 17 00:00:00 2001 From: qdp Date: Wed, 17 Sep 2008 16:58:22 +0200 Subject: [PATCH 5/5] *changed name of belgian chart template bzr revid: qdp@tinyerp.com-20080917145822-s1tusmova8hr7hzg --- addons/l10n_be/account_pcmn_belgium.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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