From 07a63fcf718a44c749de74166f84ae7fd4dcb87c Mon Sep 17 00:00:00 2001 From: mtr Date: Fri, 21 Jan 2011 12:29:40 +0530 Subject: [PATCH 01/39] [IMP] hr_holidays:In xml,added field 'name' on model=ir.actions.act_window bzr revid: mtr@mtr-20110121065940-d37nys61ta3b1556 --- addons/hr_holidays/hr_holidays_view.xml | 1 + addons/hr_holidays/report/available_holidays_view.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/addons/hr_holidays/hr_holidays_view.xml b/addons/hr_holidays/hr_holidays_view.xml index a6adb1926d2..e207c2caf7d 100644 --- a/addons/hr_holidays/hr_holidays_view.xml +++ b/addons/hr_holidays/hr_holidays_view.xml @@ -318,6 +318,7 @@ action="open_allocation_holidays"/> + Leaves Summary hr.holidays form tree,form diff --git a/addons/hr_holidays/report/available_holidays_view.xml b/addons/hr_holidays/report/available_holidays_view.xml index fa04c0ed784..730c396e168 100644 --- a/addons/hr_holidays/report/available_holidays_view.xml +++ b/addons/hr_holidays/report/available_holidays_view.xml @@ -3,6 +3,7 @@ + Leaves Analysis hr.holidays form tree,form From 222865a94f2eb55f76e053a481ec082ddee7c6da Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Fri, 21 Jan 2011 13:07:26 +0530 Subject: [PATCH 02/39] [REF] bzr revid: mra@mra-laptop-20110121073726-2k6qhs2gi2nungpd --- addons/account/account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/account.py b/addons/account/account.py index 511997ecc88..3abbe4cef2e 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -995,7 +995,7 @@ class account_journal_period(osv.osv): return super(account_journal_period, self).write(cr, uid, ids, vals, context=context) def create(self, cr, uid, vals, context=None): - period_id=vals.get('period_id',False) + period_id = vals.get('period_id',False) if period_id: period = self.pool.get('account.period').browse(cr, uid, period_id, context=context) vals['state']=period.state From 2b282ad6c99a9ada325df3d506adb55e208f85ef Mon Sep 17 00:00:00 2001 From: Olivier DOSSMANN Date: Fri, 21 Jan 2011 11:28:21 +0100 Subject: [PATCH 03/39] [FIX] fixed inversion of columns in the move_ids many2many fields in an account_move_line lp bug: https://launchpad.net/bugs/705797 fixed bzr revid: olivier@tempo-laptop-20110121102821-lbptsdh26wwqlfaf --- addons/account/account_bank_statement.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index a2e641dc39c..6d7e56d8360 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -463,7 +463,7 @@ class account_bank_statement_line(osv.osv): select=True, required=True, ondelete='cascade'), 'analytic_account_id': fields.many2one('account.analytic.account', 'Analytic Account'), 'move_ids': fields.many2many('account.move', - 'account_bank_statement_line_move_rel', 'move_id','statement_id', + 'account_bank_statement_line_move_rel', 'statement_id','move_id', 'Moves'), 'ref': fields.char('Reference', size=32), 'note': fields.text('Notes'), From eb8e18a64ae192d917d5be1ed5b052dbaec4ae74 Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Fri, 21 Jan 2011 15:58:32 +0530 Subject: [PATCH 04/39] [FIX] hr_recuritement: missing dependences in hr_recruitment lp bug: https://launchpad.net/bugs/705770 fixed bzr revid: mra@mra-laptop-20110121102832-lmrohj5t1afu1hp0 --- addons/hr_recruitment/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_recruitment/__openerp__.py b/addons/hr_recruitment/__openerp__.py index 5ac4c20184c..320d0c47b6d 100644 --- a/addons/hr_recruitment/__openerp__.py +++ b/addons/hr_recruitment/__openerp__.py @@ -33,7 +33,7 @@ system to store and search in your CV base. """, 'author': 'OpenERP SA', 'website': 'http://www.openerp.com', - 'depends': ['hr','survey','crm'], + 'depends': ['decimal_precision', 'hr', 'survey', 'crm'], 'update_xml': [ 'wizard/hr_recruitment_phonecall_view.xml', 'wizard/hr_recruitment_create_partner_job_view.xml', From 8fdc2693a56c08f8c47cb03fc82ba6978e847e45 Mon Sep 17 00:00:00 2001 From: mtr Date: Mon, 24 Jan 2011 11:11:30 +0530 Subject: [PATCH 05/39] [FIX] sale:picked progressbar now shows the amount(percentage) of picking done lp bug: https://launchpad.net/bugs/705766 fixed bzr revid: mtr@mtr-20110124054130-uegp9am6no347f6v --- addons/sale/sale.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 6e64c6589e9..7773c5d6d7d 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -95,7 +95,7 @@ class sale_order(osv.osv): for id in ids: res[id] = [0.0, 0.0] cr.execute('''SELECT - p.sale_id, sum(m.product_qty), mp.state as mp_state + p.sale_id, sum(m.product_qty), mp.state as mp_state, m.state as state, p.type as tp FROM stock_move m LEFT JOIN @@ -103,15 +103,21 @@ class sale_order(osv.osv): LEFT JOIN procurement_order mp on (mp.move_id=m.id) WHERE - p.sale_id IN %s GROUP BY mp.state, p.sale_id''', (tuple(ids),)) - for oid, nbr, mp_state in cr.fetchall(): - if mp_state == 'cancel': + p.sale_id IN %s GROUP BY m.state, mp.state, p.sale_id, p.type''', (tuple(ids),)) + + for oid, nbr, state, move_state, type_pick in cr.fetchall(): + if state == 'cancel': continue - if mp_state == 'done': + res[oid][1] += nbr or 0.0 + if state == 'done' or move_state == 'done': res[oid][0] += nbr or 0.0 - res[oid][1] += nbr or 0.0 - else: - res[oid][1] += nbr or 0.0 + + if type_pick == 'in':#this is a returned picking + res[oid][1] -= 2*nbr or 0.0 # Deducting the return picking qty + if state == 'done' or move_state == 'done': + nbr += nbr + res[oid][0] -= nbr or 0.0 + for r in res: if not res[r][1]: res[r] = 0.0 From f307cb1822f68c721b18f533c9ab9f00613f66a8 Mon Sep 17 00:00:00 2001 From: "ARA (OpenERP)" Date: Mon, 24 Jan 2011 15:25:29 +0530 Subject: [PATCH 06/39] [FIX]account: 6.0.1 account - legal reports - 'Display accounts' dropdown lp bug: https://launchpad.net/bugs/706287 fixed bzr revid: ara@tinyerp.com-20110124095529-u5wvf5sta8fdt9ed --- addons/account/report/account_balance.py | 4 ++-- addons/account/report/account_balance_sheet.py | 4 ++-- addons/account/report/account_profit_loss.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/account/report/account_balance.py b/addons/account/report/account_balance.py index 8fe9af39e00..fbf8225010f 100644 --- a/addons/account/report/account_balance.py +++ b/addons/account/report/account_balance.py @@ -89,10 +89,10 @@ class account_balance(report_sxw.rml_parse, common_report_header): self.sum_debit += account_rec['debit'] self.sum_credit += account_rec['credit'] if disp_acc == 'bal_movement': - if currency_obj.is_zero(self.cr, self.uid, currency, res['credit']) > 0 or currency_obj.is_zero(self.cr, self.uid, currency, res['debit']) > 0 or currency_obj.is_zero(self.cr, self.uid, currency, res['balance']) != 0: + if currency_obj.is_zero(self.cr, self.uid, currency, res['credit']) > 0 or currency_obj.is_zero(self.cr, self.uid, currency, res['debit']) > 0 or not currency_obj.is_zero(self.cr, self.uid, currency, res['balance']): self.result_acc.append(res) elif disp_acc == 'bal_solde': - if currency_obj.is_zero(self.cr, self.uid, currency, res['debit']) != 0: + if not currency_obj.is_zero(self.cr, self.uid, currency, res['balance']): self.result_acc.append(res) else: self.result_acc.append(res) diff --git a/addons/account/report/account_balance_sheet.py b/addons/account/report/account_balance_sheet.py index 8762b44e1e2..4be402dff7b 100644 --- a/addons/account/report/account_balance_sheet.py +++ b/addons/account/report/account_balance_sheet.py @@ -143,10 +143,10 @@ class report_balancesheet_horizontal(report_sxw.rml_parse, common_report_header) if typ == 'asset' and account.type <> 'view' and (account.debit <> account.credit): self.result_sum_cr += account.balance if data['form']['display_account'] == 'bal_movement': - if currency_pool.is_zero(self.cr, self.uid, currency, account.credit) > 0 or currency_pool.is_zero(self.cr, self.uid, currency, account.debit) > 0 or currency_pool.is_zero(self.cr, self.uid, currency, account.balance) != 0: + if currency_pool.is_zero(self.cr, self.uid, currency, account.credit) > 0 or currency_pool.is_zero(self.cr, self.uid, currency, account.debit) > 0 or not currency_pool.is_zero(self.cr, self.uid, currency, account.balance): accounts_temp.append(account_dict) elif data['form']['display_account'] == 'bal_solde': - if currency_pool.is_zero(self.cr, self.uid, currency, account.balance) != 0: + if not currency_pool.is_zero(self.cr, self.uid, currency, account.balance): accounts_temp.append(account_dict) else: accounts_temp.append(account_dict) diff --git a/addons/account/report/account_profit_loss.py b/addons/account/report/account_profit_loss.py index c17d2e7b23e..5bb3035ec24 100644 --- a/addons/account/report/account_profit_loss.py +++ b/addons/account/report/account_profit_loss.py @@ -113,10 +113,10 @@ class report_pl_account_horizontal(report_sxw.rml_parse, common_report_header): if typ == 'income' and account.type <> 'view' and (account.debit <> account.credit): self.result_sum_cr += abs(account.debit - account.credit) if data['form']['display_account'] == 'bal_movement': - if currency_pool.is_zero(self.cr, self.uid, currency, account.credit) > 0 or currency_pool.is_zero(self.cr, self.uid, currency, account.debit) > 0 or currency_pool.is_zero(self.cr, self.uid, currency, account.balance) != 0: + if currency_pool.is_zero(self.cr, self.uid, currency, account.credit) > 0 or currency_pool.is_zero(self.cr, self.uid, currency, account.debit) > 0 or not currency_pool.is_zero(self.cr, self.uid, currency, account.balance): accounts_temp.append(account) elif data['form']['display_account'] == 'bal_solde': - if currency_pool.is_zero(self.cr, self.uid, currency, account.balance) != 0: + if not currency_pool.is_zero(self.cr, self.uid, currency, account.balance): accounts_temp.append(account) else: accounts_temp.append(account) From b5cad281c42ae8b5bdf685f7bd9890b0c50e041a Mon Sep 17 00:00:00 2001 From: "ARA (OpenERP)" Date: Mon, 24 Jan 2011 16:16:10 +0530 Subject: [PATCH 07/39] [IMP]account - legal reports - 'Display accounts' dropdown bzr revid: ara@tinyerp.com-20110124104610-oiznlwb9r14y45l3 --- addons/account/report/account_balance.py | 2 +- addons/account/report/account_balance_sheet.py | 2 +- addons/account/report/account_profit_loss.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/account/report/account_balance.py b/addons/account/report/account_balance.py index fbf8225010f..5d9cfac5699 100644 --- a/addons/account/report/account_balance.py +++ b/addons/account/report/account_balance.py @@ -89,7 +89,7 @@ class account_balance(report_sxw.rml_parse, common_report_header): self.sum_debit += account_rec['debit'] self.sum_credit += account_rec['credit'] if disp_acc == 'bal_movement': - if currency_obj.is_zero(self.cr, self.uid, currency, res['credit']) > 0 or currency_obj.is_zero(self.cr, self.uid, currency, res['debit']) > 0 or not currency_obj.is_zero(self.cr, self.uid, currency, res['balance']): + if not currency_obj.is_zero(self.cr, self.uid, currency, res['credit']) > 0 or not currency_obj.is_zero(self.cr, self.uid, currency, res['debit']) > 0 or not currency_obj.is_zero(self.cr, self.uid, currency, res['balance']): self.result_acc.append(res) elif disp_acc == 'bal_solde': if not currency_obj.is_zero(self.cr, self.uid, currency, res['balance']): diff --git a/addons/account/report/account_balance_sheet.py b/addons/account/report/account_balance_sheet.py index 4be402dff7b..f22061a5785 100644 --- a/addons/account/report/account_balance_sheet.py +++ b/addons/account/report/account_balance_sheet.py @@ -143,7 +143,7 @@ class report_balancesheet_horizontal(report_sxw.rml_parse, common_report_header) if typ == 'asset' and account.type <> 'view' and (account.debit <> account.credit): self.result_sum_cr += account.balance if data['form']['display_account'] == 'bal_movement': - if currency_pool.is_zero(self.cr, self.uid, currency, account.credit) > 0 or currency_pool.is_zero(self.cr, self.uid, currency, account.debit) > 0 or not currency_pool.is_zero(self.cr, self.uid, currency, account.balance): + if not currency_pool.is_zero(self.cr, self.uid, currency, account.credit) > 0 or not currency_pool.is_zero(self.cr, self.uid, currency, account.debit) > 0 or not currency_pool.is_zero(self.cr, self.uid, currency, account.balance): accounts_temp.append(account_dict) elif data['form']['display_account'] == 'bal_solde': if not currency_pool.is_zero(self.cr, self.uid, currency, account.balance): diff --git a/addons/account/report/account_profit_loss.py b/addons/account/report/account_profit_loss.py index 5bb3035ec24..bd1635e91fc 100644 --- a/addons/account/report/account_profit_loss.py +++ b/addons/account/report/account_profit_loss.py @@ -113,7 +113,7 @@ class report_pl_account_horizontal(report_sxw.rml_parse, common_report_header): if typ == 'income' and account.type <> 'view' and (account.debit <> account.credit): self.result_sum_cr += abs(account.debit - account.credit) if data['form']['display_account'] == 'bal_movement': - if currency_pool.is_zero(self.cr, self.uid, currency, account.credit) > 0 or currency_pool.is_zero(self.cr, self.uid, currency, account.debit) > 0 or not currency_pool.is_zero(self.cr, self.uid, currency, account.balance): + if not currency_pool.is_zero(self.cr, self.uid, currency, account.credit) > 0 or not currency_pool.is_zero(self.cr, self.uid, currency, account.debit) > 0 or not currency_pool.is_zero(self.cr, self.uid, currency, account.balance): accounts_temp.append(account) elif data['form']['display_account'] == 'bal_solde': if not currency_pool.is_zero(self.cr, self.uid, currency, account.balance): From 6472a9736274689442015855a292ff6b2063885e Mon Sep 17 00:00:00 2001 From: "ARA (OpenERP)" Date: Mon, 24 Jan 2011 18:51:29 +0530 Subject: [PATCH 08/39] [FIX] account: Error creating a DTA lp bug: https://launchpad.net/bugs/705675 fixed bzr revid: ara@tinyerp.com-20110124132129-hqwsd5stpgmyc87v --- addons/l10n_ch/wizard/create_dta.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/l10n_ch/wizard/create_dta.py b/addons/l10n_ch/wizard/create_dta.py index d014c6b228a..90054fdeba0 100644 --- a/addons/l10n_ch/wizard/create_dta.py +++ b/addons/l10n_ch/wizard/create_dta.py @@ -554,7 +554,7 @@ def _create_dta(obj, cr, uid, data, context=None): dta = dta + record_gt890(v).generate() dta_data = base64.encodestring(dta) - payment_obj.set_done(cr, uid, data['id'], context) + payment_obj.set_done(cr, uid, [data['id']], context) attachment_obj.create(cr, uid, { 'name': 'DTA', 'datas': dta_data, From c65210bf098b895b23e21c2a9415467acbb1b444 Mon Sep 17 00:00:00 2001 From: mtr Date: Tue, 25 Jan 2011 12:35:16 +0530 Subject: [PATCH 09/39] [FIX] hr_payroll:removed extra table from report and changed the label lp bug: https://launchpad.net/bugs/707144 fixed bzr revid: mtr@mtr-20110125070516-4ochldcpbbywi201 --- .../report/report_payroll_advice.rml | 26 +------------------ 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/addons/hr_payroll/report/report_payroll_advice.rml b/addons/hr_payroll/report/report_payroll_advice.rml index 3e0aa3c0af1..4d110fa5aa1 100644 --- a/addons/hr_payroll/report/report_payroll_advice.rml +++ b/addons/hr_payroll/report/report_payroll_advice.rml @@ -126,30 +126,6 @@ - - - - - SI. No. - - - Name of the Employee - - - Amount - - - By Salary - - - Bank Account - - - C/D - - - - [[repeatIn(objects,'o')]] @@ -239,7 +215,7 @@ Bank Account - C/D + D/C From 407c58d8fb7b06c60b933ac3b8f976af68240a81 Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Tue, 25 Jan 2011 12:41:33 +0530 Subject: [PATCH 10/39] [FIX] Account: Reconcile with Write-Off lp bug: https://launchpad.net/bugs/706107 fixed bzr revid: mra@mra-laptop-20110125071133-gu9z7nftu7u7zr4q --- addons/account_voucher/account_voucher.py | 51 +++++++++++++------ .../voucher_payment_receipt_view.xml | 10 ++-- 2 files changed, 41 insertions(+), 20 deletions(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 6c6f2865ceb..886848c0902 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -142,31 +142,50 @@ class account_voucher(osv.osv): res['arch'] = etree.tostring(doc) return res - def _compute_writeoff_amount(self, cr, uid, line_dr_ids, line_cr_ids, amount): + def _compute_writeoff_amount(self, cr, uid, line_dr_ids, line_cr_ids, amount, context=None): + if context is None: + context = {} debit = credit = 0.0 - for l in line_dr_ids: - debit += l['amount'] - for l in line_cr_ids: - credit += l['amount'] + if context.get('based_on', 'amount') == 'amount_unreconciled': + for l in line_dr_ids: + debit += l['amount_unreconciled'] + for l in line_cr_ids: + credit += l['amount_unreconciled'] + else: + for l in line_dr_ids: + debit += l['amount'] + for l in line_cr_ids: + credit += l['amount'] return abs(amount - abs(credit - debit)) - def onchange_line_ids(self, cr, uid, ids, line_dr_ids, line_cr_ids, amount): + def onchange_line_ids(self, cr, uid, ids, line_dr_ids, line_cr_ids, amount, context=None): + if not context: + context = {} + context.update({'based_on': context.get('based_on', False)}) if not line_dr_ids and not line_cr_ids: return {'value':{}} line_dr_ids = [x[2] for x in line_dr_ids] line_cr_ids = [x[2] for x in line_cr_ids] - return {'value': {'writeoff_amount': self._compute_writeoff_amount(cr, uid, line_dr_ids, line_cr_ids, amount)}} + return {'value': {'writeoff_amount': self._compute_writeoff_amount(cr, uid, line_dr_ids, line_cr_ids, amount, context=context)}, 'context': context} def _get_writeoff_amount(self, cr, uid, ids, name, args, context=None): if not ids: return {} res = {} debit = credit = 0.0 - for voucher in self.browse(cr, uid, ids, context=context): - for l in voucher.line_dr_ids: - debit += l.amount - for l in voucher.line_cr_ids: - credit += l.amount - res[voucher.id] = abs(voucher.amount - abs(credit - debit)) + if context.get('based_on', 'amount') == 'amount_unreconciled': + for voucher in self.browse(cr, uid, ids, context=context): + for l in voucher.line_dr_ids: + debit += l.amount_unreconciled + for l in voucher.line_cr_ids: + credit += l.amount_unreconciled + res[voucher.id] = abs(voucher.amount - abs(credit - debit)) + else: + for voucher in self.browse(cr, uid, ids, context=context): + for l in voucher.line_dr_ids: + debit += l.amount + for l in voucher.line_cr_ids: + credit += l.amount + res[voucher.id] = abs(voucher.amount - abs(credit - debit)) return res _name = 'account.voucher' @@ -517,8 +536,10 @@ class account_voucher(osv.osv): default['value']['pre_line'] = 1 elif ttype == 'receipt' and len(default['value']['line_dr_ids']) > 0: default['value']['pre_line'] = 1 - default['value']['writeoff_amount'] = self._compute_writeoff_amount(cr, uid, default['value']['line_dr_ids'], default['value']['line_cr_ids'], price) - + ctx = context.copy() + ctx.update({'based_on': 'amount_unreconciled'}) + default['value']['writeoff_amount'] = self._compute_writeoff_amount(cr, uid, default['value']['line_dr_ids'], default['value']['line_cr_ids'], price, context=ctx) + default['context'] = ctx return default def onchange_date(self, cr, uid, ids, partner_id, journal_id, price, currency_id, ttype, date, context=None): diff --git a/addons/account_voucher/voucher_payment_receipt_view.xml b/addons/account_voucher/voucher_payment_receipt_view.xml index e73354eb59a..d6e382d729e 100644 --- a/addons/account_voucher/voucher_payment_receipt_view.xml +++ b/addons/account_voucher/voucher_payment_receipt_view.xml @@ -106,7 +106,7 @@ - + - + @@ -308,7 +308,7 @@ - + - + @@ -379,7 +379,7 @@ - + From 0c5d50937b4e49895d70d61232a224efb734bc8b Mon Sep 17 00:00:00 2001 From: "psi (Open ERP)" Date: Tue, 25 Jan 2011 15:28:54 +0530 Subject: [PATCH 11/39] [FIX] account: Selection of multi-company products account in invoices lines lp bug: https://launchpad.net/bugs/705043 fixed bzr revid: psi@tinyerp.co.in-20110125095854-nsj8c3g64ay1m1ui --- addons/account/invoice.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 64634e34a96..48a315ecd98 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -518,7 +518,7 @@ class account_invoice(osv.osv): if not result_id: raise osv.except_osv(_('Configuration Error !'), _('Can not find account chart for this company in invoice line account, Please Create account.')) - inv_line_obj.write(cr, uid, [line.id], {'account_id': result_id[0]}) + inv_line_obj.write(cr, uid, [line.id], {'account_id': result_id[-1]}) else: if invoice_line: for inv_line in invoice_line: @@ -1313,7 +1313,6 @@ class account_invoice_line(osv.osv): exp_pro_id = property_obj.search(cr, uid, [('name','=','property_account_expense'),('res_id','=','product.template,'+str(res.product_tmpl_id.id)+''),('company_id','=',company_id)]) if not exp_pro_id: exp_pro_id = property_obj.search(cr, uid, [('name','=','property_account_expense_categ'),('res_id','=','product.template,'+str(res.categ_id.id)+''),('company_id','=',company_id)]) - if not in_pro_id: in_acc = res.product_tmpl_id.property_account_income in_acc_cate = res.categ_id.property_account_income_categ @@ -1357,11 +1356,11 @@ class account_invoice_line(osv.osv): in_obj_acc = account_obj.browse(cr, uid, in_res_id, context=context) exp_obj_acc = account_obj.browse(cr, uid, exp_res_id, context=context) if in_acc or ex_acc: - res.product_tmpl_id.property_account_income = in_obj_acc[0] - res.product_tmpl_id.property_account_expense = exp_obj_acc[0] + res.product_tmpl_id.property_account_income = in_obj_acc[-1] + res.product_tmpl_id.property_account_expense = exp_obj_acc[-1] else: - res.categ_id.property_account_income_categ = in_obj_acc[0] - res.categ_id.property_account_expense_categ = exp_obj_acc[0] + res.categ_id.property_account_income_categ = in_obj_acc[-1] + res.categ_id.property_account_expense_categ = exp_obj_acc[-1] if type in ('out_invoice','out_refund'): a = res.product_tmpl_id.property_account_income.id From a7d9e9975c432403f9a83b0d948c3865ec538249 Mon Sep 17 00:00:00 2001 From: mtr Date: Tue, 25 Jan 2011 15:48:43 +0530 Subject: [PATCH 12/39] [IMP] l10n_ch:solved the integrity error i.e. null value in column address_invoice_id violates not-null constraintin the yaml. bzr revid: mtr@mtr-20110125101843-wwjdetjdckugcucj --- addons/l10n_ch/test/l10n_ch_report.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/addons/l10n_ch/test/l10n_ch_report.yml b/addons/l10n_ch/test/l10n_ch_report.yml index 1f4a89b93f4..8c7c64bef29 100644 --- a/addons/l10n_ch/test/l10n_ch_report.yml +++ b/addons/l10n_ch/test/l10n_ch_report.yml @@ -5,18 +5,22 @@ acc_number: 001-1001-1291-12323 bank: base.res_bank_1 bvr_number: 01-101-12 - name: Argolait Main Account - partner_id: base.res_partner_agrolait + name: Asustek Main Account + partner_id: base.res_partner_asus sequence: 0.0 state: bvbank - In order to test the BVR report, I will assign a bank to the invoice - - !record {model: account.invoice, id: account.test_invoice_1}: + !record {model: account.invoice, id: test_invoice_2}: partner_bank_id: res_partner_bank_account0 + address_invoice_id: base.res_partner_address_tang + partner_id: base.res_partner_asus + account_id: account.a_recv + company_id: base.main_company - In order to test the PDF reports defined on a l10n_ch, we will print BVR Report - !python {model: account.invoice}: | from tools.test_reports import try_report - try_report(cr, uid, 'report.invoice_web_bvr', [ref('account.test_invoice_1')]) \ No newline at end of file + try_report(cr, uid, 'report.invoice_web_bvr', [ref('test_invoice_2')]) \ No newline at end of file From 2add57ba57904a670d97a916f788028086ecbca2 Mon Sep 17 00:00:00 2001 From: "ARA (OpenERP)" Date: Thu, 27 Jan 2011 11:09:37 +0530 Subject: [PATCH 13/39] [FIX] account: [trunk][account] useless variable in button_confirm_bank lp bug: https://launchpad.net/bugs/707404 fixed bzr revid: ara@tinyerp.com-20110127053937-sbk2lu0qle04w60x --- addons/account/account_bank_statement.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index a2e641dc39c..0027080eceb 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -314,7 +314,6 @@ class account_bank_statement(osv.osv): return state=='draft' def button_confirm_bank(self, cr, uid, ids, context=None): - done = [] obj_seq = self.pool.get('ir.sequence') if context is None: context = {} @@ -355,7 +354,6 @@ class account_bank_statement(osv.osv): self.write(cr, uid, [st.id], {'name': st_number}, context=context) self.log(cr, uid, st.id, _('Statement %s is confirmed, journal items are created.') % (st_number,)) - done.append(st.id) return self.write(cr, uid, ids, {'state':'confirm'}, context=context) def button_cancel(self, cr, uid, ids, context=None): From 8bb8e9f2c380f02bfd6faaec3119ddbcabc224e7 Mon Sep 17 00:00:00 2001 From: "ARA (OpenERP)" Date: Thu, 27 Jan 2011 12:02:26 +0530 Subject: [PATCH 14/39] [REF] account: fix buildbot warning bzr revid: ara@tinyerp.com-20110127063226-2bvb74jfkjql3d29 --- addons/account/report/account_balance_landscape.py | 1 - addons/account/report/account_partner_balance.py | 1 - addons/account/wizard/account_state_open.py | 2 +- addons/account/wizard/account_use_model.py | 2 +- 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/addons/account/report/account_balance_landscape.py b/addons/account/report/account_balance_landscape.py index 8576850ff5e..a11d3bc285d 100644 --- a/addons/account/report/account_balance_landscape.py +++ b/addons/account/report/account_balance_landscape.py @@ -207,7 +207,6 @@ class account_balance_landscape(report_sxw.rml_parse): return cmp(x.code, y.code) for n in range(0,len(accounts)): accounts[n].sort(cmp_code) - common={} merged_accounts=zip(*accounts) for entry in merged_accounts: diff --git a/addons/account/report/account_partner_balance.py b/addons/account/report/account_partner_balance.py index eacafb02eda..187b9b2578f 100644 --- a/addons/account/report/account_partner_balance.py +++ b/addons/account/report/account_partner_balance.py @@ -296,7 +296,6 @@ class partner_balance(report_sxw.rml_parse, common_report_header): def _get_partners(self): cr, uid = self.cr, self.uid - context = self.localcontext # all of it? if self.result_selection == 'customer': return _('Receivable Accounts') diff --git a/addons/account/wizard/account_state_open.py b/addons/account/wizard/account_state_open.py index 81705771d67..62e837b7366 100644 --- a/addons/account/wizard/account_state_open.py +++ b/addons/account/wizard/account_state_open.py @@ -36,7 +36,7 @@ class account_state_open(osv.osv_memory): if data_inv.reconciled: raise osv.except_osv(_('Warning'), _('Invoice is already reconciled')) wf_service = netsvc.LocalService("workflow") - res = wf_service.trg_validate(uid, 'account.invoice', context['active_ids'][0], 'open_test', cr) + wf_service.trg_validate(uid, 'account.invoice', context['active_ids'][0], 'open_test', cr) return {'type': 'ir.actions.act_window_close'} account_state_open() diff --git a/addons/account/wizard/account_use_model.py b/addons/account/wizard/account_use_model.py index 15719dcf138..6e444b8b4e6 100644 --- a/addons/account/wizard/account_use_model.py +++ b/addons/account/wizard/account_use_model.py @@ -107,7 +107,7 @@ class account_use_model(osv.osv_memory): }) c = context.copy() c.update({'journal_id': model.journal_id.id,'period_id': period_id}) - id_line = account_move_line_obj.create(cr, uid, val, context=c) + account_move_line_obj.create(cr, uid, val, context=c) context.update({'move_ids':move_ids}) model_data_ids = mod_obj.search(cr, uid,[('model','=','ir.ui.view'),('name','=','view_move_form')], context=context) From 3e15579e3f0bf792d413fe60d2816aeb0a1a2893 Mon Sep 17 00:00:00 2001 From: mtr Date: Thu, 27 Jan 2011 12:56:35 +0530 Subject: [PATCH 15/39] [IMP] account:remove the print statement bzr revid: mtr@mtr-20110127072635-c3r0f3qndwk69pcc --- addons/account/report/account_report.py | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/account/report/account_report.py b/addons/account/report/account_report.py index 39edecbbbfc..8a77ce47280 100644 --- a/addons/account/report/account_report.py +++ b/addons/account/report/account_report.py @@ -99,7 +99,6 @@ class report_aged_receivable(osv.osv): return res def _calc_bal(self, cr, uid, ids, name, args, context=None): - print"-dfdfd-----" res = {} for period in self.read(cr, uid, ids, ['name'], context=context): date1,date2 = period['name'].split(' to ') From c9fee124ca40ee60a45280f9a3d654c342e687ca Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Thu, 27 Jan 2011 16:56:19 +0530 Subject: [PATCH 16/39] [FIX] Account_voucher: Reconcile with Write-Off => For write off option now it will consider amount_reconciled instead of amount on voucher line and if you pay via write off option and your amount=0 then it will consider voucher line now lp bug: https://launchpad.net/bugs/706107 fixed bzr revid: mra@mra-laptop-20110127112619-89hvzyc4ct3e34ws --- addons/account_voucher/account_voucher.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 886848c0902..bf5f059a376 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -722,13 +722,16 @@ class account_voucher(osv.osv): for line in inv.line_ids: #create one move line per voucher line where amount is not 0.0 - if not line.amount: + if not line.amount and not inv.payment_option == 'with_writeoff': continue #we check if the voucher line is fully paid or not and create a move line to balance the payment and initial invoice if needed if line.amount == line.amount_unreconciled: amount = line.move_line_id.amount_residual #residual amount in company currency else: - amount = currency_pool.compute(cr, uid, current_currency, company_currency, line.untax_amount or line.amount, context=context_multi_currency) + if inv.payment_option == 'with_writeoff': + amount = currency_pool.compute(cr, uid, current_currency, company_currency, line.amount_unreconciled or line.amount, context=context_multi_currency) + else: + amount = currency_pool.compute(cr, uid, current_currency, company_currency, line.untax_amount or line.amount, context=context_multi_currency) move_line = { 'journal_id': inv.journal_id.id, 'period_id': inv.period_id.id, @@ -749,7 +752,6 @@ class account_voucher(osv.osv): line.type = 'cr' else: line.type = 'dr' - if (line.type=='dr'): line_total += amount move_line['debit'] = amount From 59fdbf0236477850f4c30560c8e8f8f68c92b67c Mon Sep 17 00:00:00 2001 From: "ARA (OpenERP)" Date: Thu, 27 Jan 2011 19:04:57 +0530 Subject: [PATCH 17/39] [FIX] Account_payment: Select Invoices to Pay button on payment order not working lp bug: https://launchpad.net/bugs/707398 fixed bzr revid: ara@tinyerp.com-20110127133457-65ndqaxbawiti2ca --- .../account_payment/wizard/account_payment_create_order_view.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/account_payment/wizard/account_payment_create_order_view.xml b/addons/account_payment/wizard/account_payment_create_order_view.xml index d301e72e1ab..905baf7e118 100644 --- a/addons/account_payment/wizard/account_payment_create_order_view.xml +++ b/addons/account_payment/wizard/account_payment_create_order_view.xml @@ -43,6 +43,7 @@ payment.order.create form form + new From 5235c605cd01ae70bc5610f265f15911e2df67fe Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Fri, 28 Jan 2011 11:15:49 +0530 Subject: [PATCH 18/39] [FIX] Account: Residual Value miscalculated lp bug: https://launchpad.net/bugs/708405 fixed bzr revid: mra@mra-laptop-20110128054549-srjxoazwo73cmv92 --- addons/account/invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 48a315ecd98..077094aa2dc 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -94,7 +94,7 @@ class account_invoice(osv.osv): if invoice.move_id: for m in invoice.move_id.line_id: if m.account_id.type in ('receivable','payable'): - result[invoice.id] = m.amount_residual_currency + result[invoice.id] += m.amount_residual_currency return result # Give Journal Items related to the payment reconciled to this invoice From 375b07ba7a76d824d6805b7824dd3968ac8398c2 Mon Sep 17 00:00:00 2001 From: "ARA (OpenERP)" Date: Fri, 28 Jan 2011 11:57:40 +0530 Subject: [PATCH 19/39] [REF] l10n_fr:revert this account type = view whose child bzr revid: ara@tinyerp.com-20110128062740-2uvxk1w1sh6s299r --- .../l10n_fr/plan_comptable_general_demo.xml | 366 +++++++++--------- 1 file changed, 183 insertions(+), 183 deletions(-) diff --git a/addons/l10n_fr/plan_comptable_general_demo.xml b/addons/l10n_fr/plan_comptable_general_demo.xml index 32aff2f638a..59fac9fc1eb 100644 --- a/addons/l10n_fr/plan_comptable_general_demo.xml +++ b/addons/l10n_fr/plan_comptable_general_demo.xml @@ -162,7 +162,7 @@ Capital 101 - view + other Capital pour sociétés de type (SARL, SA). Pour une EI utiliser le compte 108 @@ -190,7 +190,7 @@ Capital souscrit - appelé versé 1013 - view + other @@ -226,7 +226,7 @@ Primes liées au capital social 104 - view + other @@ -280,7 +280,7 @@ Écarts de réévaluation 105 - view + other @@ -343,7 +343,7 @@ Réserves 106 - view + other @@ -352,7 +352,7 @@ Réserve légale 1061 - view + other @@ -397,7 +397,7 @@ Réserves réglementées 1064 - view + other @@ -433,7 +433,7 @@ Autres réserves 1068 - view + other @@ -551,7 +551,7 @@ Subventions d'équipement 131 - view + other @@ -641,7 +641,7 @@ Subventions d'investissement inscrites au compte de résultat 139 - view + other @@ -650,7 +650,7 @@ Subventions d'équipement 1391 - view + other @@ -749,7 +749,7 @@ Provisions réglementées relatives aux immobilisations 142 - view + other @@ -776,7 +776,7 @@ Provisions réglementées relatives aux stocks 143 - view + other @@ -857,7 +857,7 @@ Provisions pour risques 151 - view + other @@ -965,7 +965,7 @@ Provisions pour charges à répartir sur plusieurs exercices 157 - view + other @@ -983,7 +983,7 @@ Autres provisions pour charges 158 - view + other @@ -1037,7 +1037,7 @@ Dépôts et cautionnements reçus 165 - view + other @@ -1064,7 +1064,7 @@ Participation des salariés aux résultats 166 - view + other @@ -1091,7 +1091,7 @@ Emprunts et dettes assortis de conditions particulières 167 - view + other @@ -1127,7 +1127,7 @@ Autres emprunts et dettes assimilées 168 - view + other @@ -1163,7 +1163,7 @@ Intérêts courus 1688 - view + other @@ -1271,7 +1271,7 @@ Dettes rattachées à des sociétés en participation 178 - view + other @@ -1362,7 +1362,7 @@ Frais d'établissement 201 - view + other @@ -1380,7 +1380,7 @@ Frais de premier établissement 2012 - view + other @@ -1471,7 +1471,7 @@ Terrains 211 - view + other @@ -1507,7 +1507,7 @@ Terrains de gisement 2114 - view + other @@ -1525,7 +1525,7 @@ Terrains bâtis 2115 - view + other @@ -1552,7 +1552,7 @@ Autres ensembles immobiliers 21158 - view + other @@ -1597,7 +1597,7 @@ Constructions 213 - view + other @@ -1606,7 +1606,7 @@ Bâtiments 2131 - view + other @@ -1633,7 +1633,7 @@ Autres ensembles immobiliers 21318 - view + other @@ -1669,7 +1669,7 @@ Ouvrages d'infrastructure 2138 - view + other @@ -1732,7 +1732,7 @@ Installations techniques matériels et outillages industriels 215 - view + other @@ -1741,7 +1741,7 @@ Installations complexes spécialisées 2151 - view + other @@ -1768,7 +1768,7 @@ Installations à caractère spécifique 2153 - view + other @@ -1822,7 +1822,7 @@ Autres immobilisations corporelles 218 - view + other @@ -1903,7 +1903,7 @@ Immobilisations corporelles en cours 231 - view + other @@ -1967,7 +1967,7 @@ Avances et acomptes versés sur commandes d'immobilisations corporelles 238 - view + other @@ -2030,7 +2030,7 @@ Titres de participation 261 - view + other Pas d'amortissement sur les titres de participation @@ -2078,7 +2078,7 @@ Créances rattachées à des participations 267 - view + other @@ -2141,7 +2141,7 @@ Créances rattachées à des sociétés en participation 268 - view + other @@ -2187,7 +2187,7 @@ Titres immobilisés autres que les titres immobilisés de l'activité de portefeuille (droit de propriété) 271 - view + other @@ -2214,7 +2214,7 @@ Titres immobilisés (droit de créance) 272 - view + other @@ -2250,7 +2250,7 @@ Prêts 274 - view + other @@ -2295,7 +2295,7 @@ Dépôts et cautionnements versés 275 - view + other ex : badge autoroute.. @@ -2323,7 +2323,7 @@ Autres créances immobilisées 276 - view + other @@ -2341,7 +2341,7 @@ Intérêts courus 2768 - view + other @@ -2386,7 +2386,7 @@ Actions propres ou parts propres 277 - view + other @@ -2432,7 +2432,7 @@ Amortissements des immobilisations incorporelles 280 - view + other @@ -2486,7 +2486,7 @@ Amortissements des immobilisations corporelles 281 - view + other @@ -2567,7 +2567,7 @@ Dépréciations des immobilisations incorporelles 290 - view + other @@ -2612,7 +2612,7 @@ Dépréciations des immobilisations corporelles (même ventilation que celle du compte 21) 291 - view + other @@ -2639,7 +2639,7 @@ Dépréciations des immobilisations en cours 293 - view + other @@ -2666,7 +2666,7 @@ Provisions pour dépréciation des participations et créances rattachées à des participations 296 - view + other @@ -2711,7 +2711,7 @@ Dépréciations des autres immobilisations financières 297 - view + other @@ -2853,7 +2853,7 @@ Fournitures consommables 322 - view + other @@ -2907,7 +2907,7 @@ Emballages 326 - view + other @@ -2952,7 +2952,7 @@ Produits en cours 331 - view + other @@ -2979,7 +2979,7 @@ Travaux en cours 335 - view + other @@ -3015,7 +3015,7 @@ Études en cours 341 - view + other @@ -3078,7 +3078,7 @@ Produits intermédiaires 351 - view + other @@ -3105,7 +3105,7 @@ Produits finis 355 - view + other @@ -3132,7 +3132,7 @@ Produits résiduels (ou matières de récupération) 358 - view + other @@ -3222,7 +3222,7 @@ Provisions pour dépréciation des matières premières (et fournitures) 391 - view + other @@ -3258,7 +3258,7 @@ Provisions pour dépréciation des autres approvisionnements 392 - view + other @@ -3294,7 +3294,7 @@ Provisions pour dépréciation des en-cours de production de biens 393 - view + other @@ -3321,7 +3321,7 @@ Provisions pour dépréciation des en-cours de production de services 394 - view + other @@ -3348,7 +3348,7 @@ Provisions pour dépréciation des stocks de produits 395 - view + other @@ -3375,7 +3375,7 @@ Provisions pour dépréciation des stocks de marchandises 397 - view + other @@ -3466,7 +3466,7 @@ Fournisseurs d'immobilisations 404 - view + payable @@ -3502,7 +3502,7 @@ Fournisseurs - Factures non parvenues 408 - view + other @@ -3571,7 +3571,7 @@ Fournisseurs - Autres avoirs 4097 - view + other @@ -3683,7 +3683,7 @@ Clients - Produits non encore facturés 418 - view + other @@ -3792,7 +3792,7 @@ Participation des salariés aux résultats 424 - view + other @@ -3852,7 +3852,7 @@ Personnel - Charges à payer et produits à recevoir 428 - view + other @@ -3931,7 +3931,7 @@ Organismes sociaux - Charges à payer et produits à recevoir 438 - view + other @@ -3980,7 +3980,7 @@ État - Subventions à recevoir 441 - view + receivable @@ -4030,7 +4030,7 @@ État -Impôts et taxes recouvrables sur des tiers 442 - view + other @@ -4060,7 +4060,7 @@ Opérations particulières avec l'État, les collectivités publiques, les organismes internationaux 443 - view + other @@ -4100,7 +4100,7 @@ État - Taxes sur le chiffre d'affaires 445 - view + other @@ -4110,7 +4110,7 @@ TVA due intracommunautaire 4452 - view + other @@ -4150,7 +4150,7 @@ Taxes sur le chiffre d'affaires à décaisser 4455 - view + other @@ -4210,7 +4210,7 @@ TVA sur autres biens et services 44566 - view + other @@ -4261,7 +4261,7 @@ TVA collectée 44571 - view + other @@ -4311,7 +4311,7 @@ Taxes sur le chiffre d'affaires à régulariser ou en attente 4458 - view + other @@ -4401,7 +4401,7 @@ État - Charges à payer et produits à recevoir 448 - view + other @@ -4470,7 +4470,7 @@ Associés - Comptes courants 455 - view + receivable Pour frais avancés personnellement @@ -4501,7 +4501,7 @@ Associés - Opérations sur le capital 456 - view + receivable @@ -4511,7 +4511,7 @@ Associés - Comptes d'apport en société 4561 - view + receivable @@ -4541,7 +4541,7 @@ Apporteurs - Capital appelé, non versé 4562 - view + receivable @@ -4621,7 +4621,7 @@ Associés - Opérations faites en commun et en GIE 458 - view + receivable @@ -4699,7 +4699,7 @@ Divers - Charges à payer et produits à recevoir 468 - view + receivable @@ -4788,7 +4788,7 @@ Différences de conversion - ACTIF 476 - view + receivable @@ -4828,7 +4828,7 @@ Différences de conversion - PASSIF 477 - view + other @@ -4886,7 +4886,7 @@ Charges à répartir sur plusieurs exercices 481 - view + receivable @@ -4984,7 +4984,7 @@ Dépréciation des comptes du groupe et des associés 495 - view + other @@ -5024,7 +5024,7 @@ Dépréciations des comptes de débiteurs divers 496 - view + receivable @@ -5100,7 +5100,7 @@ Actions 503 - view + other @@ -5145,7 +5145,7 @@ Obligations 506 - view + other @@ -5181,7 +5181,7 @@ Autres valeurs mobilières de placement et autres créances assimilées 508 - view + other @@ -5235,7 +5235,7 @@ Valeurs à l'encaissement 511 - view + other @@ -5345,7 +5345,7 @@ Intérêts courus 518 - view + other @@ -5372,7 +5372,7 @@ Concours bancaires courants 519 - view + other @@ -5426,7 +5426,7 @@ Caisse siège social 531 - view + other @@ -5499,7 +5499,7 @@ Provisions pour dépréciation des valeurs mobilières de placement 590 - view + other @@ -5571,7 +5571,7 @@ Achats stockés - Matières premières (et fournitures) 601 - view + other Destinés à la production ou revente @@ -5608,7 +5608,7 @@ Achats stockés - Autres approvisionnements 602 - view + other Destinés à la production ou revente @@ -5618,7 +5618,7 @@ Matières consommables 6021 - view + other @@ -5645,7 +5645,7 @@ Fournitures consommables 6022 - view + other @@ -5699,7 +5699,7 @@ Emballages 6026 - view + other @@ -5736,7 +5736,7 @@ Variation des stocks (approvisionnements et marchandises) 603 - view + other Utilisé lors des inventaires @@ -5793,7 +5793,7 @@ Achats non stockés de matières et fournitures 606 - view + other Pour l'usage interne à l'entreprise @@ -5839,7 +5839,7 @@ Achats de marchandises 607 - view + other Biens revendus tels quels (707) soit une marge @@ -5878,7 +5878,7 @@ Rabais, remises et ristournes obtenus sur achats 609 - view + other @@ -5968,7 +5968,7 @@ Redevances de crédit-bail 612 - view + other @@ -5995,7 +5995,7 @@ Locations 613 - view + other @@ -6040,7 +6040,7 @@ Entretien et réparations 615 - view + other @@ -6076,7 +6076,7 @@ Primes d'assurance 616 - view + other @@ -6103,7 +6103,7 @@ Assurance transport 6163 - view + other @@ -6166,7 +6166,7 @@ Divers 618 - view + other @@ -6220,7 +6220,7 @@ Personnel extérieur à l'entreprise 621 - view + other @@ -6247,7 +6247,7 @@ Rémunérations d'intermédiaires et honoraires 622 - view + other @@ -6319,7 +6319,7 @@ Publicité, publications, relations publiques 623 - view + other Dont annonces légales, greffe, cartes visites @@ -6402,7 +6402,7 @@ Transports de biens et transports collectifs du personnel 624 - view + other @@ -6465,7 +6465,7 @@ Déplacements missions et réceptions 625 - view + other @@ -6519,7 +6519,7 @@ Services bancaires et assimilés 627 - view + other Frais de tenue de compte, etc @@ -6574,7 +6574,7 @@ Divers 628 - view + other @@ -6620,7 +6620,7 @@ Impôts, taxes et versements assimilés sur rémunérations (administration des impôts) 631 - view + other @@ -6674,7 +6674,7 @@ Impôts, taxes et versements assimilés sur rémunérations (autres organismes) 633 - view + other @@ -6737,7 +6737,7 @@ Autres impôts, taxes et versements assimilés (administration des impôts) 635 - view + other @@ -6746,7 +6746,7 @@ Impôts directs (sauf impôts sur les bénéfices) 6351 - view + other @@ -6809,7 +6809,7 @@ Droits d'enregistrement et de timbre 6354 - view + other @@ -6836,7 +6836,7 @@ Autres impôts, taxes et versements assimilés (autres organismes) 637 - view + other @@ -6890,7 +6890,7 @@ Rémunérations du personnel 641 - view + other @@ -7016,7 +7016,7 @@ Autres charges sociales 647 - view + other @@ -7088,7 +7088,7 @@ Redevances pour concessions, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires 651 - view + other @@ -7133,7 +7133,7 @@ Pertes sur créances irrécouvrables 654 - view + other Faire et conserver les relances et mises en demeures @@ -7161,7 +7161,7 @@ Quotes-parts de résultat sur opérations faites en commun 655 - view + other @@ -7207,7 +7207,7 @@ Charges d'intérêt 661 - view + other @@ -7216,7 +7216,7 @@ Intérêts des emprunts et dettes 6611 - view + other @@ -7270,7 +7270,7 @@ Intérêts des autres dettes 6618 - view + other @@ -7352,7 +7352,7 @@ Charges exceptionnelles sur opérations de gestion 671 - view + other @@ -7434,7 +7434,7 @@ Valeurs comptables des éléments d'actif cédés 675 - view + other Vente d'immobilisation = (Valeur d'origine - amortissements) (contrepartie 775) @@ -7481,7 +7481,7 @@ Autres charges exceptionnelles 678 - view + other @@ -7535,7 +7535,7 @@ Dotations aux amortissements, dépréciations et provisions - Charges d'exploitation 681 - view + other @@ -7544,7 +7544,7 @@ Dotations aux amortissements des immobilisations incorporelles et corporelles 6811 - view + other @@ -7589,7 +7589,7 @@ Dotations pour dépréciations des immobilisations incorporelles et corporelles 6816 - view + other @@ -7616,7 +7616,7 @@ Dotations aux provisions pour dépréciation des actifs circulants 6817 - view + other @@ -7643,7 +7643,7 @@ Dotations aux amortissements, dépréciations et provisions - Charges financières 686 - view + other @@ -7670,7 +7670,7 @@ Dotations aux dépréciation des éléments financiers 6866 - view + other @@ -7706,7 +7706,7 @@ Dotations aux amortissements, dépréciations et provisions - Charges exceptionnelles 687 - view + other @@ -7724,7 +7724,7 @@ Dotations aux provisions réglementées (immobilisations) 6872 - view + other @@ -7796,7 +7796,7 @@ Impôts sur les bénéfices 695 - view + other @@ -7850,7 +7850,7 @@ Intégration fiscale 698 - view + other @@ -7904,7 +7904,7 @@ Ventes de produits finis 701 - view + other @@ -7950,7 +7950,7 @@ Travaux 704 - view + other @@ -7995,7 +7995,7 @@ Ventes de marchandises 707 - view + other 707-607 = marge commerciale (contrepartie 607) @@ -8032,7 +8032,7 @@ Produits des activités annexes 708 - view + other Activité accessoire ou occasionnelle @@ -8114,7 +8114,7 @@ Rabais, remises et ristournes accordés par l'entreprise 709 - view + other @@ -8195,7 +8195,7 @@ Variation des stocks (en-cours de production, produits) 713 - view + other @@ -8204,7 +8204,7 @@ Variation des en-cours de production de biens 7133 - view + other @@ -8231,7 +8231,7 @@ Variation des en-cours de production de services 7134 - view + other @@ -8258,7 +8258,7 @@ Variation des stocks de produits 7135 - view + other @@ -8339,7 +8339,7 @@ Redevances pour concessions, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires 751 - view + other @@ -8402,7 +8402,7 @@ Quotes-parts de résultats sur opérations faites en commun 755 - view + other @@ -8448,7 +8448,7 @@ Produits de participations 761 - view + other @@ -8484,7 +8484,7 @@ Produits des autres immobilisations financières 762 - view + other @@ -8520,7 +8520,7 @@ Revenus des autres créances 763 - view + other @@ -8602,7 +8602,7 @@ Produits exceptionnels sur opérations de gestion 771 - view + other Écarts d'arrondis @@ -8675,7 +8675,7 @@ Produits des cessions d'éléments d'actif 775 - view + other vente d'immobilisation = prix de vente (contrepartie 675) @@ -8730,7 +8730,7 @@ Autres produits exceptionnels 778 - view + other @@ -8784,7 +8784,7 @@ Reprises sur amortissements, dépréciations et provisions (à inscrire dans les produits d'exploitation) 781 - view + other @@ -8793,7 +8793,7 @@ Reprises sur amortissements des immobilisations incorporelles et corporelles 7811 - view + other @@ -8829,7 +8829,7 @@ Reprises sur dépréciations des immobilisations corporelles et incorporelles 7816 - view + other @@ -8856,7 +8856,7 @@ Reprises sur dépréciations des actifs circulants 7817 - view + other @@ -8883,7 +8883,7 @@ Reprises sur dépréciations et provisions (à inscrire dans les produits financiers) 786 - view + other @@ -8901,7 +8901,7 @@ Reprises sur dépréciations des éléments financiers 7866 - view + other @@ -8928,7 +8928,7 @@ Reprises sur dépréciations et provisions (à inscrire dans les produits exceptionnels) 787 - view + other @@ -8937,7 +8937,7 @@ Reprises sur provisions réglementées (immobilisations) 7872 - view + other @@ -9063,7 +9063,7 @@ Engagements donnés par l'entité 801 - view + other @@ -9090,7 +9090,7 @@ Redevances crédit-bail restant à courir 8016 - view + other @@ -9126,7 +9126,7 @@ Engagements reçus par l'entité 802 - view + other @@ -9153,7 +9153,7 @@ Engagements reçus pour utilisation en crédit-bail 8026 - view + other From 5438979397584b60c19e9aee2cc58fe449fd85cc Mon Sep 17 00:00:00 2001 From: "ARA (OpenERP)" Date: Fri, 28 Jan 2011 14:49:06 +0530 Subject: [PATCH 20/39] [FIX] Account: Can not display list of analytic entries when you open it's list view from Analytic Account form lp bug: https://launchpad.net/bugs/708593 fixed bzr revid: ara@tinyerp.com-20110128091906-bqo6ced09d4rc9si --- addons/analytic/analytic.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/analytic/analytic.py b/addons/analytic/analytic.py index 124607112a9..84124d94cf4 100644 --- a/addons/analytic/analytic.py +++ b/addons/analytic/analytic.py @@ -109,12 +109,12 @@ class account_analytic_account(osv.osv): def _complete_name_calc(self, cr, uid, ids, prop, unknow_none, unknow_dict): res = self.name_get(cr, uid, ids) return dict(res) - + def _child_compute(self, cr, uid, ids, name, arg, context=None): result = {} if context is None: context = {} - + for account in self.browse(cr, uid, ids, context=context): for child in account.child_ids: if child.state == 'template': @@ -229,6 +229,7 @@ class account_analytic_account(osv.osv): return self.name_get(cr, uid, project_ids, context=context) account = self.search(cr, uid, [('code', '=', name)]+args, limit=limit, context=context) if not account: + name = name.split('/ ')[-1] account = self.search(cr, uid, [('name', 'ilike', '%%%s%%' % name)]+args, limit=limit, context=context) newacc = account while newacc: From 7864489978b2451371796bb3e96c68b9275875c3 Mon Sep 17 00:00:00 2001 From: "qdp-launchpad@tinyerp.com" <> Date: Fri, 28 Jan 2011 12:24:10 +0100 Subject: [PATCH 21/39] [REF] account, invoice.py: refactored the product_id_change of invoice lines. Removed filthy code that was choosing the account based on the company passed in context and it should be the one currently set in the current user preferences bzr revid: qdp-launchpad@tinyerp.com-20110128112410-ql9457hfwxj4pejd --- addons/account/invoice.py | 58 --------------------------------------- 1 file changed, 58 deletions(-) diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 077094aa2dc..7fd5c6f688f 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -1304,64 +1304,6 @@ class account_invoice_line(osv.osv): result = {} res = self.pool.get('product.product').browse(cr, uid, product, context=context) - if company_id: - property_obj = self.pool.get('ir.property') - account_obj = self.pool.get('account.account') - in_pro_id = property_obj.search(cr, uid, [('name','=','property_account_income'),('res_id','=','product.template,'+str(res.product_tmpl_id.id)+''),('company_id','=',company_id)]) - if not in_pro_id: - in_pro_id = property_obj.search(cr, uid, [('name','=','property_account_income_categ'),('res_id','=','product.template,'+str(res.categ_id.id)+''),('company_id','=',company_id)]) - exp_pro_id = property_obj.search(cr, uid, [('name','=','property_account_expense'),('res_id','=','product.template,'+str(res.product_tmpl_id.id)+''),('company_id','=',company_id)]) - if not exp_pro_id: - exp_pro_id = property_obj.search(cr, uid, [('name','=','property_account_expense_categ'),('res_id','=','product.template,'+str(res.categ_id.id)+''),('company_id','=',company_id)]) - if not in_pro_id: - in_acc = res.product_tmpl_id.property_account_income - in_acc_cate = res.categ_id.property_account_income_categ - if in_acc: - app_acc_in = in_acc - else: - app_acc_in = in_acc_cate - else: - # Get the fields from the ir.property record - my_value = property_obj.read(cr,uid,in_pro_id,['name','value_reference','res_id']) - # Parse the value_reference field to get the ID of the account.account record - account_id = int (my_value[0]["value_reference"].split(",")[1]) - # Use the ID of the account.account record in the browse for the account.account record - app_acc_in = account_obj.browse(cr, uid, account_id, context=context) - if not exp_pro_id: - ex_acc = res.product_tmpl_id.property_account_expense - ex_acc_cate = res.categ_id.property_account_expense_categ - if ex_acc: - app_acc_exp = ex_acc - else: - app_acc_exp = ex_acc_cate - else: - app_acc_exp = account_obj.browse(cr, uid, exp_pro_id, context=context)[0] - if not in_pro_id and not exp_pro_id: - in_acc = res.product_tmpl_id.property_account_income - in_acc_cate = res.categ_id.property_account_income_categ - ex_acc = res.product_tmpl_id.property_account_expense - ex_acc_cate = res.categ_id.property_account_expense_categ - if in_acc or ex_acc: - app_acc_in = in_acc - app_acc_exp = ex_acc - else: - app_acc_in = in_acc_cate - app_acc_exp = ex_acc_cate - if app_acc_in and app_acc_in.company_id.id != company_id and app_acc_exp and app_acc_exp.company_id.id != company_id: - in_res_id = account_obj.search(cr, uid, [('name','=',app_acc_in.name),('company_id','=',company_id)]) - exp_res_id = account_obj.search(cr, uid, [('name','=',app_acc_exp.name),('company_id','=',company_id)]) - if not in_res_id and not exp_res_id: - raise osv.except_osv(_('Configuration Error !'), - _('Can not find account chart for this company, Please Create account.')) - in_obj_acc = account_obj.browse(cr, uid, in_res_id, context=context) - exp_obj_acc = account_obj.browse(cr, uid, exp_res_id, context=context) - if in_acc or ex_acc: - res.product_tmpl_id.property_account_income = in_obj_acc[-1] - res.product_tmpl_id.property_account_expense = exp_obj_acc[-1] - else: - res.categ_id.property_account_income_categ = in_obj_acc[-1] - res.categ_id.property_account_expense_categ = exp_obj_acc[-1] - if type in ('out_invoice','out_refund'): a = res.product_tmpl_id.property_account_income.id if not a: From c70e22c1a212d0f8af9671dbc135fb74a488fd7a Mon Sep 17 00:00:00 2001 From: mtr Date: Fri, 28 Jan 2011 17:14:50 +0530 Subject: [PATCH 22/39] [FIX] account: allows duplication of account lp bug: https://launchpad.net/bugs/708603 fixed bzr revid: mtr@mtr-20110128114450-998ho3olsdfno7yw --- addons/account/account.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index 3abbe4cef2e..bd0839243a5 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -300,11 +300,13 @@ class account_account(osv.osv): brs.pop(0) for fn in field_names: sums.setdefault(current.id, {})[fn] = accounts.get(current.id, {}).get(fn, 0.0) - for child in current.child_id: - if child.company_id.currency_id.id == current.company_id.currency_id.id: - sums[current.id][fn] += sums[child.id][fn] - else: - sums[current.id][fn] += currency_obj.compute(cr, uid, child.company_id.currency_id.id, current.company_id.currency_id.id, sums[child.id][fn], context=context) + if current.child_id: + for child in current.child_id: + if child.company_id.currency_id.id == current.company_id.currency_id.id: + if sums.get(child.id): + sums[current.id][fn] += sums[child.id][fn] + else: + sums[current.id][fn] += currency_obj.compute(cr, uid, child.company_id.currency_id.id, current.company_id.currency_id.id, sums[child.id][fn], context=context) res = {} null_result = dict((fn, 0.0) for fn in field_names) for id in ids: From b32167875e0c0b21bc019b2c30695d37353afffc Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Fri, 28 Jan 2011 19:02:54 +0530 Subject: [PATCH 23/39] [REVERT] account voucher changes bzr revid: mra@mra-laptop-20110128133254-iljzm4pavbzqwk7a --- addons/account_voucher/account_voucher.py | 57 ++++++------------- .../voucher_payment_receipt_view.xml | 8 +-- 2 files changed, 20 insertions(+), 45 deletions(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index bf5f059a376..5b662a960c5 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -142,50 +142,31 @@ class account_voucher(osv.osv): res['arch'] = etree.tostring(doc) return res - def _compute_writeoff_amount(self, cr, uid, line_dr_ids, line_cr_ids, amount, context=None): - if context is None: - context = {} + def _compute_writeoff_amount(self, cr, uid, line_dr_ids, line_cr_ids, amount): debit = credit = 0.0 - if context.get('based_on', 'amount') == 'amount_unreconciled': - for l in line_dr_ids: - debit += l['amount_unreconciled'] - for l in line_cr_ids: - credit += l['amount_unreconciled'] - else: - for l in line_dr_ids: - debit += l['amount'] - for l in line_cr_ids: - credit += l['amount'] + for l in line_dr_ids: + debit += l['amount'] + for l in line_cr_ids: + credit += l['amount'] return abs(amount - abs(credit - debit)) - def onchange_line_ids(self, cr, uid, ids, line_dr_ids, line_cr_ids, amount, context=None): - if not context: - context = {} - context.update({'based_on': context.get('based_on', False)}) + def onchange_line_ids(self, cr, uid, ids, line_dr_ids, line_cr_ids, amount): if not line_dr_ids and not line_cr_ids: return {'value':{}} line_dr_ids = [x[2] for x in line_dr_ids] line_cr_ids = [x[2] for x in line_cr_ids] - return {'value': {'writeoff_amount': self._compute_writeoff_amount(cr, uid, line_dr_ids, line_cr_ids, amount, context=context)}, 'context': context} + return {'value': {'writeoff_amount': self._compute_writeoff_amount(cr, uid, line_dr_ids, line_cr_ids, amount)}} def _get_writeoff_amount(self, cr, uid, ids, name, args, context=None): if not ids: return {} res = {} debit = credit = 0.0 - if context.get('based_on', 'amount') == 'amount_unreconciled': - for voucher in self.browse(cr, uid, ids, context=context): - for l in voucher.line_dr_ids: - debit += l.amount_unreconciled - for l in voucher.line_cr_ids: - credit += l.amount_unreconciled - res[voucher.id] = abs(voucher.amount - abs(credit - debit)) - else: - for voucher in self.browse(cr, uid, ids, context=context): - for l in voucher.line_dr_ids: - debit += l.amount - for l in voucher.line_cr_ids: - credit += l.amount - res[voucher.id] = abs(voucher.amount - abs(credit - debit)) + for voucher in self.browse(cr, uid, ids, context=context): + for l in voucher.line_dr_ids: + debit += l.amount + for l in voucher.line_cr_ids: + credit += l.amount + res[voucher.id] = abs(voucher.amount - abs(credit - debit)) return res _name = 'account.voucher' @@ -536,10 +517,7 @@ class account_voucher(osv.osv): default['value']['pre_line'] = 1 elif ttype == 'receipt' and len(default['value']['line_dr_ids']) > 0: default['value']['pre_line'] = 1 - ctx = context.copy() - ctx.update({'based_on': 'amount_unreconciled'}) - default['value']['writeoff_amount'] = self._compute_writeoff_amount(cr, uid, default['value']['line_dr_ids'], default['value']['line_cr_ids'], price, context=ctx) - default['context'] = ctx + default['value']['writeoff_amount'] = self._compute_writeoff_amount(cr, uid, default['value']['line_dr_ids'], default['value']['line_cr_ids'], price) return default def onchange_date(self, cr, uid, ids, partner_id, journal_id, price, currency_id, ttype, date, context=None): @@ -722,16 +700,13 @@ class account_voucher(osv.osv): for line in inv.line_ids: #create one move line per voucher line where amount is not 0.0 - if not line.amount and not inv.payment_option == 'with_writeoff': + if not line.amount: continue #we check if the voucher line is fully paid or not and create a move line to balance the payment and initial invoice if needed if line.amount == line.amount_unreconciled: amount = line.move_line_id.amount_residual #residual amount in company currency else: - if inv.payment_option == 'with_writeoff': - amount = currency_pool.compute(cr, uid, current_currency, company_currency, line.amount_unreconciled or line.amount, context=context_multi_currency) - else: - amount = currency_pool.compute(cr, uid, current_currency, company_currency, line.untax_amount or line.amount, context=context_multi_currency) + amount = currency_pool.compute(cr, uid, current_currency, company_currency, line.untax_amount or line.amount, context=context_multi_currency) move_line = { 'journal_id': inv.journal_id.id, 'period_id': inv.period_id.id, diff --git a/addons/account_voucher/voucher_payment_receipt_view.xml b/addons/account_voucher/voucher_payment_receipt_view.xml index d6e382d729e..20c73bb9797 100644 --- a/addons/account_voucher/voucher_payment_receipt_view.xml +++ b/addons/account_voucher/voucher_payment_receipt_view.xml @@ -106,7 +106,7 @@ - + - + @@ -308,7 +308,7 @@ - + - + From 8f1a2329168513459785ae64ab9a2db9786bae84 Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Fri, 28 Jan 2011 19:06:40 +0530 Subject: [PATCH 24/39] [IMP] hr_payroll: add pto header on pay advice rml bzr revid: mra@mra-laptop-20110128133640-4zu70ghbsisp0oes --- .../report/report_payroll_advice.rml | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/addons/hr_payroll/report/report_payroll_advice.rml b/addons/hr_payroll/report/report_payroll_advice.rml index 4d110fa5aa1..c3c1f9dd50e 100644 --- a/addons/hr_payroll/report/report_payroll_advice.rml +++ b/addons/hr_payroll/report/report_payroll_advice.rml @@ -126,6 +126,30 @@ + + + + + SI. No. + + + Name of the Employee + + + Amount + + + By Salary + + + Bank Account + + + D/C + + + + [[repeatIn(objects,'o')]] From 6127d931f3b19f62269943c094b59bec87c878f9 Mon Sep 17 00:00:00 2001 From: mtr Date: Mon, 31 Jan 2011 12:06:45 +0530 Subject: [PATCH 25/39] [FIX] account: allows duplication of account lp bug: https://launchpad.net/bugs/708603 fixed bzr revid: mtr@mtr-20110131063645-pjwyyj3uv1jp40i1 --- addons/account/account.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index bd0839243a5..e9b0c9e7905 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -300,13 +300,12 @@ class account_account(osv.osv): brs.pop(0) for fn in field_names: sums.setdefault(current.id, {})[fn] = accounts.get(current.id, {}).get(fn, 0.0) - if current.child_id: - for child in current.child_id: - if child.company_id.currency_id.id == current.company_id.currency_id.id: - if sums.get(child.id): - sums[current.id][fn] += sums[child.id][fn] - else: - sums[current.id][fn] += currency_obj.compute(cr, uid, child.company_id.currency_id.id, current.company_id.currency_id.id, sums[child.id][fn], context=context) + for child in current.child_id: + if child.company_id.currency_id.id == current.company_id.currency_id.id: + if sums.get(child.id, False): + sums[current.id][fn] += sums[child.id][fn] + else: + sums[current.id][fn] += currency_obj.compute(cr, uid, child.company_id.currency_id.id, current.company_id.currency_id.id, sums[child.id][fn], context=context) res = {} null_result = dict((fn, 0.0) for fn in field_names) for id in ids: From 60ac3e49e1db82291e17f7bb83694c8f850ca75a Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Mon, 31 Jan 2011 12:18:45 +0530 Subject: [PATCH 26/39] [FIX] hr_holidays: can not refuse an approved holidays => due to case_id was char lp bug: https://launchpad.net/bugs/709130 fixed bzr revid: mra@mra-laptop-20110131064845-2joefqn4oqh1gob1 --- addons/hr_holidays/hr_holidays.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/hr_holidays/hr_holidays.py b/addons/hr_holidays/hr_holidays.py index 3e7a4a1b3a2..a7d9a1129bd 100644 --- a/addons/hr_holidays/hr_holidays.py +++ b/addons/hr_holidays/hr_holidays.py @@ -111,7 +111,7 @@ class hr_holidays(osv.osv): _columns = { 'name': fields.char('Description', required=True, size=64), - 'state': fields.selection([('draft', 'Draft'), ('confirm', 'Waiting Approval'), ('refuse', 'Refused'), + 'state': fields.selection([('draft', 'Draft'), ('confirm', 'Waiting Approval'), ('refuse', 'Refused'), ('validate1', 'Waiting Second Approval'), ('validate', 'Approved'), ('cancel', 'Cancelled')], 'State', readonly=True, help='When the holiday request is created the state is \'Draft\'.\n It is confirmed by the user and request is sent to admin, the state is \'Waiting Approval\'.\ If the admin accepts it, the state is \'Approved\'. If it is refused, the state is \'Refused\'.'), @@ -290,7 +290,7 @@ class hr_holidays(osv.osv): for record in self.browse(cr, uid, ids): # Delete the meeting if record.case_id: - obj_crm_meeting.unlink(cr, uid, [record.case_id]) + obj_crm_meeting.unlink(cr, uid, [int(record.case_id)]) # If a category that created several holidays, cancel all related wf_service = netsvc.LocalService("workflow") From f1d38b5844dc5ad40935e0b2d16f246329d418ae Mon Sep 17 00:00:00 2001 From: mtr Date: Mon, 31 Jan 2011 13:07:05 +0530 Subject: [PATCH 27/39] [IMP] account:placed else condition inside 'if sums.get(child.id, False):' bzr revid: mtr@mtr-20110131073705-2m6d54pjia4y1506 --- addons/account/account.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index e9b0c9e7905..6d4fe4eb98f 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -304,8 +304,8 @@ class account_account(osv.osv): if child.company_id.currency_id.id == current.company_id.currency_id.id: if sums.get(child.id, False): sums[current.id][fn] += sums[child.id][fn] - else: - sums[current.id][fn] += currency_obj.compute(cr, uid, child.company_id.currency_id.id, current.company_id.currency_id.id, sums[child.id][fn], context=context) + else: + sums[current.id][fn] += currency_obj.compute(cr, uid, child.company_id.currency_id.id, current.company_id.currency_id.id, sums[child.id][fn], context=context) res = {} null_result = dict((fn, 0.0) for fn in field_names) for id in ids: From 6847838d4b9bc1505a2f894bf7934437eac1ce33 Mon Sep 17 00:00:00 2001 From: mtr Date: Mon, 31 Jan 2011 13:32:07 +0530 Subject: [PATCH 28/39] [IMP] account:improved code for the account duplication bug bzr revid: mtr@mtr-20110131080207-hmsbxkmonkvdh3to --- addons/account/account.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index 6d4fe4eb98f..8a2cbdb8451 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -301,8 +301,8 @@ class account_account(osv.osv): for fn in field_names: sums.setdefault(current.id, {})[fn] = accounts.get(current.id, {}).get(fn, 0.0) for child in current.child_id: - if child.company_id.currency_id.id == current.company_id.currency_id.id: - if sums.get(child.id, False): + if sums.get(child.id, False): + if child.company_id.currency_id.id == current.company_id.currency_id.id: sums[current.id][fn] += sums[child.id][fn] else: sums[current.id][fn] += currency_obj.compute(cr, uid, child.company_id.currency_id.id, current.company_id.currency_id.id, sums[child.id][fn], context=context) From a78c1cf7ca3e021105b2b9772f0b1bfd1d9fc845 Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Mon, 31 Jan 2011 13:35:56 +0530 Subject: [PATCH 29/39] [FIX] hr_expense: hr_expense: amounts must not be float lp bug: https://launchpad.net/bugs/709667 fixed bzr revid: mra@mra-laptop-20110131080556-jpw0ek3nwoojkxbf --- addons/hr_expense/hr_expense.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/hr_expense/hr_expense.py b/addons/hr_expense/hr_expense.py index f3d5f9657cb..40e0091d05e 100644 --- a/addons/hr_expense/hr_expense.py +++ b/addons/hr_expense/hr_expense.py @@ -24,6 +24,7 @@ import time import netsvc from osv import fields, osv from tools.translate import _ +import decimal_precision as dp def _employee_get(obj, cr, uid, context=None): if context is None: @@ -225,8 +226,8 @@ class hr_expense_line(osv.osv): 'name': fields.char('Expense Note', size=128, required=True), 'date_value': fields.date('Date', required=True), 'expense_id': fields.many2one('hr.expense.expense', 'Expense', ondelete='cascade', select=True), - 'total_amount': fields.function(_amount, method=True, string='Total'), - 'unit_amount': fields.float('Unit Price'), + 'total_amount': fields.function(_amount, method=True, string='Total', digits_compute=dp.get_precision('Account')), + 'unit_amount': fields.float('Unit Price', digits_compute=dp.get_precision('Account')), 'unit_quantity': fields.float('Quantities' ), 'product_id': fields.many2one('product.product', 'Product', domain=[('hr_expense_ok','=',True)]), 'uom_id': fields.many2one('product.uom', 'UoM' ), From a101b76a36bdbf5844918ebcffe8309e4c9f28a0 Mon Sep 17 00:00:00 2001 From: "ARA (OpenERP)" Date: Mon, 31 Jan 2011 15:01:30 +0530 Subject: [PATCH 30/39] [REF] Account: Can not display list of analytic entries when you open it's list view from Analytic Account form bzr revid: ara@tinyerp.com-20110131093130-d1jo5lb8kiywrhrb --- addons/account/project/project_view.xml | 2 +- addons/analytic/analytic.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/addons/account/project/project_view.xml b/addons/account/project/project_view.xml index 46867c8bf23..161b061c18c 100644 --- a/addons/account/project/project_view.xml +++ b/addons/account/project/project_view.xml @@ -445,7 +445,7 @@ Date: Mon, 31 Jan 2011 15:31:46 +0530 Subject: [PATCH 31/39] [IMP] Account: Can not display list of analytic entries when you open it's list view from Analytic Account form bzr revid: ara@tinyerp.com-20110131100146-mkmyrjiz9uylr2yd --- addons/account/project/project_view.xml | 2 +- addons/analytic/analytic.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/addons/account/project/project_view.xml b/addons/account/project/project_view.xml index 161b061c18c..495efbede08 100644 --- a/addons/account/project/project_view.xml +++ b/addons/account/project/project_view.xml @@ -445,7 +445,7 @@ Date: Mon, 31 Jan 2011 15:43:45 +0530 Subject: [PATCH 32/39] [IMP] Account: Can not display list bzr revid: ara@tinyerp.com-20110131101345-mnqgppe0p9hmozuy --- addons/analytic/analytic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/analytic/analytic.py b/addons/analytic/analytic.py index 1a72e878fcf..092a09fe773 100644 --- a/addons/analytic/analytic.py +++ b/addons/analytic/analytic.py @@ -230,7 +230,7 @@ class account_analytic_account(osv.osv): account = self.search(cr, uid, [('code', '=', name)]+args, limit=limit, context=context) if not account: if context.get('analytic_act_window', False): - account = self.search(cr, uid, [('id', '=', context.get('active_id'))]+args, limit=limit, context=context) + account = self.search(cr, uid, [('id', '=', context['active_id'])]+args, limit=limit, context=context) else: account = self.search(cr, uid, [('name', 'ilike', '%%%s%%' % name)]+args, limit=limit, context=context) newacc = account From 42c1d73c407605de795d50731150c6db256508af Mon Sep 17 00:00:00 2001 From: "qdp-launchpad@tinyerp.com" <> Date: Mon, 31 Jan 2011 15:16:29 +0100 Subject: [PATCH 33/39] [REF] sale: refactored the picked_rate function of the sale.order bzr revid: qdp-launchpad@tinyerp.com-20110131141629-ei4zorjxez5ch4cl --- addons/sale/sale.py | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 7773c5d6d7d..03462c04233 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -92,10 +92,11 @@ class sale_order(osv.osv): if not ids: return {} res = {} + tmp = {} for id in ids: - res[id] = [0.0, 0.0] + tmp[id] = {'picked': 0.0, 'total': 0.0} cr.execute('''SELECT - p.sale_id, sum(m.product_qty), mp.state as mp_state, m.state as state, p.type as tp + p.sale_id as sale_order_id, sum(m.product_qty) as nbr, mp.state as procurement_state, m.state as move_state, p.type as picking_type FROM stock_move m LEFT JOIN @@ -105,27 +106,24 @@ class sale_order(osv.osv): WHERE p.sale_id IN %s GROUP BY m.state, mp.state, p.sale_id, p.type''', (tuple(ids),)) - for oid, nbr, state, move_state, type_pick in cr.fetchall(): - if state == 'cancel': + for item in cr.dictfetchall(): + if item['move_state'] == 'cancel': continue - res[oid][1] += nbr or 0.0 - if state == 'done' or move_state == 'done': - res[oid][0] += nbr or 0.0 - - if type_pick == 'in':#this is a returned picking - res[oid][1] -= 2*nbr or 0.0 # Deducting the return picking qty - if state == 'done' or move_state == 'done': - nbr += nbr - res[oid][0] -= nbr or 0.0 - - for r in res: - if not res[r][1]: - res[r] = 0.0 + + if item['picking_type'] == 'in':#this is a returned picking + tmp[item['sale_order_id']]['total'] -= item['nbr'] or 0.0 # Deducting the return picking qty + if item['procurement_state'] == 'done' or item['move_state'] == 'done': + tmp[item['sale_order_id']]['picked'] -= item['nbr'] or 0.0 else: - res[r] = 100.0 * res[r][0] / res[r][1] + tmp[item['sale_order_id']]['total'] += item['nbr'] or 0.0 + if item['procurement_state'] == 'done' or item['move_state'] == 'done': + tmp[item['sale_order_id']]['picked'] += item['nbr'] or 0.0 + for order in self.browse(cr, uid, ids, context=context): if order.shipped: res[order.id] = 100.0 + else: + res[order.id] = tmp[order.id]['total'] and (100.0 * tmp[order.id]['picked'] / tmp[order.id]['total']) or 0.0 return res def _invoiced_rate(self, cursor, user, ids, name, arg, context=None): From 91316c1ade95957057ac63f192f7935d538c6aec Mon Sep 17 00:00:00 2001 From: "jvo(Open ERP)" <> Date: Tue, 1 Feb 2011 14:57:32 +0530 Subject: [PATCH 34/39] [FIX] hr_attendance : Correction on wizard of sign in/out [Ref: SaaS maintenance case 3896] bzr revid: mtr@mtr-20110201092732-90wsc9y1yl3fx9ar --- addons/hr_attendance/hr_attendance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_attendance/hr_attendance.py b/addons/hr_attendance/hr_attendance.py index 07ef528a7c9..7699e7468d9 100644 --- a/addons/hr_attendance/hr_attendance.py +++ b/addons/hr_attendance/hr_attendance.py @@ -75,7 +75,7 @@ class hr_attendance(osv.osv): LIMIT 2 ''' cr.execute(sql,(id,id)) atts = cr.fetchall() - if not ((len(atts)==1 and atts[0][0] == 'sign_in') or (atts[0][0] != atts[1][0] and atts[0][1] != atts[1][1])): + if not ((len(atts)==1 and atts[0][0] == 'sign_in') or (len(atts)==2 and atts[0][0] != atts[1][0] and atts[0][1] != atts[1][1])): return False return True From b3f7d9a1ea6bc6bbb7e75c45c41078735a49b709 Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Tue, 1 Feb 2011 15:13:48 +0530 Subject: [PATCH 35/39] [FIX] l10n_fr: correct property account for product catg (income and expense) + cash bzr revid: mra@mra-laptop-20110201094348-dqk1zeqcuc103vhn --- addons/l10n_fr/fr_pcg_taxes_demo.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/l10n_fr/fr_pcg_taxes_demo.xml b/addons/l10n_fr/fr_pcg_taxes_demo.xml index 11f6465096f..54a8d2d7444 100644 --- a/addons/l10n_fr/fr_pcg_taxes_demo.xml +++ b/addons/l10n_fr/fr_pcg_taxes_demo.xml @@ -361,11 +361,11 @@ France PCMN - + - - + +