From 99c52b7b8b7b09fa4736619f5bb23b2a694d81ab Mon Sep 17 00:00:00 2001 From: "qdp-launchpad@tinyerp.com" <> Date: Wed, 3 Nov 2010 11:49:56 +0100 Subject: [PATCH 01/11] [FIX] account_payment: allowed to choose a bank journal as well as a cash journal to encode payment order bzr revid: qdp-launchpad@tinyerp.com-20101103104956-psx112ccc9ipqkxn --- addons/account_payment/account_payment.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account_payment/account_payment.py b/addons/account_payment/account_payment.py index 750edccf389..3e4de9ff87d 100644 --- a/addons/account_payment/account_payment.py +++ b/addons/account_payment/account_payment.py @@ -32,7 +32,7 @@ class payment_mode(osv.osv): 'bank_id': fields.many2one('res.partner.bank', "Bank account", required=True,help='Bank Account for the Payment Mode'), 'journal': fields.many2one('account.journal', 'Journal', required=True, - domain=[('type', '=', 'cash')], help='Cash Journal for the Payment Mode'), + domain=[('type', 'in', ('bank','cash'))], help='Bank or Cash Journal for the Payment Mode'), 'company_id': fields.many2one('res.company', 'Company', required=True), } _defaults = { @@ -452,4 +452,4 @@ class payment_line(osv.osv): payment_line() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From a9e67f3f3de25973182bffe16c3c7787411199b0 Mon Sep 17 00:00:00 2001 From: "qdp-launchpad@tinyerp.com" <> Date: Wed, 3 Nov 2010 11:58:48 +0100 Subject: [PATCH 02/11] [IMP] l10n_be: set the default taxes when generating the chart of account from templates bzr revid: qdp-launchpad@tinyerp.com-20101103105848-bwwt7jeahbtcbjzi --- addons/l10n_be/account_pcmn_belgium.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/l10n_be/account_pcmn_belgium.xml b/addons/l10n_be/account_pcmn_belgium.xml index 3471a184d62..3f494ae443c 100644 --- a/addons/l10n_be/account_pcmn_belgium.xml +++ b/addons/l10n_be/account_pcmn_belgium.xml @@ -6725,6 +6725,7 @@ TVA 21% Services V-NAT-S 21 + percent @@ -6899,6 +6900,7 @@ Services Divers Déductibles 21% A-NAT-S 21 + percent purchase From 28b0d9cc48b5fb1fb6edba18d15639d7a529e7a4 Mon Sep 17 00:00:00 2001 From: vth Date: Wed, 3 Nov 2010 17:14:34 +0530 Subject: [PATCH 03/11] [MERGE] merge from trunk-dev-addons-3 bzr revid: vth@tinyerp.com-20101103114434-2ghb5pg9fmtxccw6 --- addons/sale/sale.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 19ceaf50e2c..d9f9677e97c 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -180,12 +180,11 @@ class sale_order(osv.osv): if arg[2]: clause += 'AND inv.state = \'paid\'' else: - clause += 'AND inv.state != \'cancel\' AND sale.state != \'cancel\' AND inv.state <> \'paid\' AND rel.order_id = sale.id ' -# clause += 'AND inv.state <> \'paid\'' + clause += 'AND inv.state <> \'paid\'' no_invoiced = True cursor.execute('SELECT rel.order_id ' \ - 'FROM sale_order_invoice_rel AS rel, account_invoice AS inv, sale_order AS sale ' \ + 'FROM sale_order_invoice_rel AS rel, account_invoice AS inv ' \ 'WHERE rel.invoice_id = inv.id ' + clause) res = cursor.fetchall() @@ -194,7 +193,7 @@ class sale_order(osv.osv): 'FROM sale_order AS sale ' \ 'WHERE sale.id NOT IN ' \ '(SELECT rel.order_id ' \ - 'FROM sale_order_invoice_rel AS rel) and sale.state != \'cancel\'') + 'FROM sale_order_invoice_rel AS rel) ') res.extend(cursor.fetchall()) if not res: return [('id', '=', 0)] From b648470328eaee45d485c864a637421046f3c99c Mon Sep 17 00:00:00 2001 From: vth Date: Wed, 3 Nov 2010 18:00:07 +0530 Subject: [PATCH 04/11] [FIX] sale : _invoiced_search returns wrong results for unpaid lp bug: https://launchpad.net/bugs/661653 fixed bzr revid: vth@tinyerp.com-20101103123007-uwzt1y1u5epqzubg --- addons/sale/sale.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index d9f9677e97c..e7b76df6d18 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -175,25 +175,26 @@ class sale_order(osv.osv): return [] clause = '' no_invoiced = False + sale_clause = '' for arg in args: if arg[1] == '=': if arg[2]: clause += 'AND inv.state = \'paid\'' else: - clause += 'AND inv.state <> \'paid\'' + clause += 'AND inv.state != \'cancel\' AND sale.state != \'cancel\' AND inv.state <> \'paid\' AND rel.order_id = sale.id ' + sale_clause = ', sale_order AS sale ' no_invoiced = True cursor.execute('SELECT rel.order_id ' \ - 'FROM sale_order_invoice_rel AS rel, account_invoice AS inv ' \ + 'FROM sale_order_invoice_rel AS rel, account_invoice AS inv '+ sale_clause + \ 'WHERE rel.invoice_id = inv.id ' + clause) - res = cursor.fetchall() if no_invoiced: cursor.execute('SELECT sale.id ' \ 'FROM sale_order AS sale ' \ 'WHERE sale.id NOT IN ' \ '(SELECT rel.order_id ' \ - 'FROM sale_order_invoice_rel AS rel) ') + 'FROM sale_order_invoice_rel AS rel) and sale.state != \'cancel\'') res.extend(cursor.fetchall()) if not res: return [('id', '=', 0)] From fc19da17ca2f304524c8f3e3997664620ad9d74e Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Wed, 3 Nov 2010 18:57:03 +0530 Subject: [PATCH 05/11] [REF] bzr revid: mra@mra-laptop-20101103132703-yd7jsf8aoy7ifyy7 --- addons/account/account.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index 90947a59ae4..999f447dcc9 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -2959,18 +2959,18 @@ class wizard_multi_charts_accounts(osv.osv_memory): wizard_multi_charts_accounts() class account_bank_accounts_wizard(osv.osv_memory): - _name='account.bank.accounts.wizard' + _name = 'account.bank.accounts.wizard' _columns = { - 'acc_name':fields.char('Account Name.', size=64, required=True), - 'bank_account_id':fields.many2one('wizard.multi.charts.accounts', 'Bank Account', required=True), - 'currency_id':fields.many2one('res.currency', 'Currency'), - 'account_type':fields.selection([('cash','Cash'),('check','Check'),('bank','Bank')], 'Type', size=32), + 'acc_name': fields.char('Account Name.', size=64, required=True), + 'bank_account_id': fields.many2one('wizard.multi.charts.accounts', 'Bank Account', required=True), + 'currency_id': fields.many2one('res.currency', 'Currency'), + 'account_type': fields.selection([('cash','Cash'),('check','Check'),('bank','Bank')], 'Type', size=32), } _defaults = { 'currency_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.currency_id.id, - } + } account_bank_accounts_wizard() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file From fd4c44f3f48607c9b323b92b54eac86d70b48523 Mon Sep 17 00:00:00 2001 From: vth Date: Wed, 3 Nov 2010 19:00:30 +0530 Subject: [PATCH 06/11] [FIX] account: Bank statement in _order add id desc lp bug: https://launchpad.net/bugs/430690 fixed bzr revid: vth@tinyerp.com-20101103133030-3vj44ct2ks3r5u2g --- 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 41cb20ba2d1..5396efe66d4 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -141,7 +141,7 @@ class account_bank_statement(osv.osv): res[statement_id] = (currency_id, currency_names[currency_id]) return res - _order = "date desc" + _order = "date desc ,id desc" _name = "account.bank.statement" _description = "Bank Statement" _columns = { From 2d2b4ae521efb92a8b389718ce669a2d6f37a878 Mon Sep 17 00:00:00 2001 From: "Jay (OpenERP)" Date: Wed, 3 Nov 2010 20:37:35 +0530 Subject: [PATCH 07/11] [FIX] CRM : Phonecall if called from Lead should use the phone field of Lead lp bug: https://launchpad.net/bugs/670292 fixed bzr revid: jvo@tinyerp.com-20101103150735-z616aq5gxyrmlhdb --- addons/crm/crm_opportunity_menu.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/crm_opportunity_menu.xml b/addons/crm/crm_opportunity_menu.xml index 9a065571324..6b2e2d0fc39 100644 --- a/addons/crm/crm_opportunity_menu.xml +++ b/addons/crm/crm_opportunity_menu.xml @@ -9,7 +9,7 @@ res_model="crm.phonecall" src_model="crm.lead" view_mode="tree,calendar,form" - context="{'default_duration': 1.0 ,'default_opportunity_id': active_id}" + context="{'default_duration': 1.0 ,'default_opportunity_id': active_id,'default_partner_phone':phone}" domain="[('opportunity_id', '=', active_id)]" view_type="form"/> From b1cf8c3afb4d45904174c133d6951b9a8102c75f Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 3 Nov 2010 16:24:55 +0100 Subject: [PATCH 08/11] [FIX] layout of base_module_import_view bzr revid: xmo@openerp.com-20101103152455-o79qfxbjw7k9kasd --- .../base/module/wizard/base_module_import_view.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/bin/addons/base/module/wizard/base_module_import_view.xml b/bin/addons/base/module/wizard/base_module_import_view.xml index b04bc050e97..8e43789b057 100644 --- a/bin/addons/base/module/wizard/base_module_import_view.xml +++ b/bin/addons/base/module/wizard/base_module_import_view.xml @@ -9,22 +9,22 @@
- + - - + - + - + From b0153c5d55fff17cfc90d25e011100895bc1e1bf Mon Sep 17 00:00:00 2001 From: "Jay (OpenERP)" Date: Wed, 3 Nov 2010 21:14:59 +0530 Subject: [PATCH 09/11] [FIX] Sale : Proper priority assigned to SO List view lp bug: https://launchpad.net/bugs/658650 fixed bzr revid: jvo@tinyerp.com-20101103154459-t3czwfma43sealrk --- addons/sale/sale_view.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml index 5c3690504c2..a8e8da47072 100644 --- a/addons/sale/sale_view.xml +++ b/addons/sale/sale_view.xml @@ -82,6 +82,7 @@ sale.order.tree sale.order tree + 2 From f73b20a8798881f4bbab821637ca27146a2c917e Mon Sep 17 00:00:00 2001 From: "qdp-launchpad@tinyerp.com" <> Date: Wed, 3 Nov 2010 16:59:52 +0100 Subject: [PATCH 10/11] [FIX] account_followup: fixed the report on followups sent + several usability fixes bzr revid: qdp-launchpad@tinyerp.com-20101103155952-jlqctu5h0tsmwuaj --- .../report/account_followup_print.py | 9 +-- .../report/account_followup_report.py | 74 +++++++------------ .../report/account_followup_report.xml | 19 ++--- .../security/ir.model.access.csv | 1 + .../wizard/account_followup_print.py | 49 +++++++++++- .../wizard/account_followup_print_view.xml | 34 ++++++++- 6 files changed, 119 insertions(+), 67 deletions(-) diff --git a/addons/account_followup/report/account_followup_print.py b/addons/account_followup/report/account_followup_print.py index 4d1cd131619..c601aaac13c 100644 --- a/addons/account_followup/report/account_followup_print.py +++ b/addons/account_followup/report/account_followup_print.py @@ -37,13 +37,12 @@ class report_rappel(report_sxw.rml_parse): 'get_text': self._get_text }) - def _ids_to_objects(self, partners_ids): + def _ids_to_objects(self, partner_ids): pool = pooler.get_pool(self.cr.dbname) all_partners = [] - for partner in partners_ids: - partners = pool.get('account_followup.stat').browse(self.cr, self.uid, [partner]) - for par in partners: - all_partners.append(par.name) + for partner in pool.get('res.partner').browse(self.cr, self.uid, partner_ids): + if partner not in all_partners: + all_partners.append(partner) return all_partners def _adr_get(self, partner, type): diff --git a/addons/account_followup/report/account_followup_report.py b/addons/account_followup/report/account_followup_report.py index 00dfe3a9998..0cfc5cd4671 100644 --- a/addons/account_followup/report/account_followup_report.py +++ b/addons/account_followup/report/account_followup_report.py @@ -22,20 +22,13 @@ from osv import fields, osv import tools -def _code_get(self, cr, uid, context={}): - acc_type_obj = self.pool.get('account.account.type') - ids = acc_type_obj.search(cr, uid, []) - res = acc_type_obj.read(cr, uid, ids, ['code', 'name'], context) - return [(r['code'], r['name']) for r in res] - - class account_followup_stat(osv.osv): _name = "account_followup.stat" _description = "Followup Statistics" + _rec_name = 'partner_id' _auto = False _columns = { - 'name': fields.many2one('res.partner', 'Partner', readonly=True), - 'account_type': fields.selection(_code_get, 'Account Type', readonly=True), + 'partner_id': fields.many2one('res.partner', 'Partner', readonly=True), 'date_move':fields.date('First move', readonly=True), 'date_move_last':fields.date('Last move', readonly=True), 'date_followup':fields.date('Latest followup', readonly=True), @@ -58,10 +51,7 @@ class account_followup_stat(osv.osv): current_year = self.pool.get('account.fiscalyear').find(cr, uid) ids = self.pool.get('account.fiscalyear').read(cr, uid, [current_year], ['period_ids'])[0]['period_ids'] args.append(['period_id','in',ids]) - for a in [['period_id','in','current_year']]: - temp_args = tuple(a) - if temp_args in args: - args.remove(temp_args) + args.remove(arg) return super(account_followup_stat, self).search(cr, uid, args=args, offset=offset, limit=limit, order=order, context=context, count=count) @@ -72,47 +62,37 @@ class account_followup_stat(osv.osv): current_year = self.pool.get('account.fiscalyear').find(cr, uid) ids = self.pool.get('account.fiscalyear').read(cr, uid, [current_year], ['period_ids'])[0]['period_ids'] domain.append(['period_id','in',ids]) - todel.append(arg) - for a in [['period_id','in','current_year']]: - temp_args = tuple(a) - if temp_args in domain: - domain.remove(temp_args) + domain.remove(arg) return super(account_followup_stat, self).read_group(cr, uid, domain, fields, groupby, offset, limit, context) def init(self, cr): tools.drop_view_if_exists(cr, 'account_followup_stat') cr.execute(""" create or replace view account_followup_stat as ( - select - l.partner_id as id, - l.partner_id as name, - min(l.date) as date_move, - max(l.date) as date_move_last, - max(l.followup_date) as date_followup, - max(l.followup_line_id) as followup_id, - sum(l.debit) as debit, - sum(l.credit) as credit, - sum(l.debit - l.credit) as balance, - a.type as account_type, - l.company_id as company_id, - l.blocked, - am.period_id as period_id - from + SELECT + l.id AS id, + l.partner_id AS partner_id, + min(l.date) AS date_move, + max(l.date) AS date_move_last, + max(l.followup_date) AS date_followup, + max(l.followup_line_id) AS followup_id, + sum(l.debit) AS debit, + sum(l.credit) AS credit, + sum(l.debit - l.credit) AS balance, + l.company_id AS company_id, + l.blocked as blocked, + l.period_id AS period_id + FROM account_move_line l - LEFT JOIN account_account a ON (l.account_id=a.id) - LEFT JOIN res_company c ON (l.company_id=c.id) - LEFT JOIN account_move am ON (am.id=l.move_id) - LEFT JOIN account_period p ON (am.period_id=p.id) - where - l.reconcile_id is NULL and - a.type = 'receivable' - and a.active and - l.partner_id is not NULL and - l.company_id is not NULL and - l.blocked is not NULL - group by - l.partner_id, a.type, l.company_id,l.blocked,am.period_id + LEFT JOIN account_account a ON (l.account_id = a.id) + WHERE + a.active AND + a.type = 'receivable' AND + l.reconcile_id is NULL AND + l.partner_id IS NOT NULL + GROUP BY + l.id, l.partner_id, l.company_id, l.blocked, l.period_id )""") account_followup_stat() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_followup/report/account_followup_report.xml b/addons/account_followup/report/account_followup_report.xml index 73b2740a43b..fdde1f9300f 100644 --- a/addons/account_followup/report/account_followup_report.xml +++ b/addons/account_followup/report/account_followup_report.xml @@ -8,15 +8,15 @@ tree - + - - + + @@ -30,7 +30,7 @@ graph - + @@ -51,18 +51,20 @@ domain="[('blocked','=', False)]" help = "Including journal entries marked as a litigation"/> - + - - + + + + @@ -76,9 +78,8 @@ {'search_default_followup_level':1,'search_default_fiscalyear':1} - - + diff --git a/addons/account_followup/security/ir.model.access.csv b/addons/account_followup/security/ir.model.access.csv index 60d179d3cbe..7b7e2af7ba8 100644 --- a/addons/account_followup/security/ir.model.access.csv +++ b/addons/account_followup/security/ir.model.access.csv @@ -4,3 +4,4 @@ "access_account_followup_followup_line_manager","account_followup.followup.line.manager","model_account_followup_followup_line","account.group_account_manager",1,1,1,1 "access_account_followup_followup_accountant","account_followup.followup user","model_account_followup_followup","account.group_account_user",1,0,0,0 "access_account_followup_stat_invoice","account_followup.stat.invoice","model_account_followup_stat","account.group_account_invoice",1,1,1,1 +"access_account_followup_stat_by_partner_manager","account_followup.stat.by.partner","model_account_followup_stat_by_partner","account.group_account_manager",1,1,1,1 diff --git a/addons/account_followup/wizard/account_followup_print.py b/addons/account_followup/wizard/account_followup_print.py index be353220e99..22f432f77f6 100644 --- a/addons/account_followup/wizard/account_followup_print.py +++ b/addons/account_followup/wizard/account_followup_print.py @@ -67,14 +67,55 @@ class account_followup_print(osv.osv_memory): 'date': time.strftime('%Y-%m-%d'), 'followup_id': _get_followup, } - account_followup_print() +class account_followup_stat_by_partner(osv.osv): + _name = "account_followup.stat.by.partner" + _description = "Followup Statistics by Partner" + _rec_name = 'partner_id' + _auto = False + _columns = { + 'partner_id': fields.many2one('res.partner', 'Partner', readonly=True), + 'date_move':fields.date('First move', readonly=True), + 'date_move_last':fields.date('Last move', readonly=True), + 'date_followup':fields.date('Latest followup', readonly=True), + 'max_followup_id': fields.many2one('account_followup.followup.line', + 'Max Follow Up Level', readonly=True, ondelete="cascade"), + 'balance':fields.float('Balance', readonly=True), + 'company_id': fields.many2one('res.company', 'Company', readonly=True), + } + + def init(self, cr): + tools.drop_view_if_exists(cr, 'account_followup_stat_by_partner') + cr.execute(""" + create or replace view account_followup_stat_by_partner as ( + SELECT + l.partner_id AS id, + l.partner_id AS partner_id, + min(l.date) AS date_move, + max(l.date) AS date_move_last, + max(l.followup_date) AS date_followup, + max(l.followup_line_id) AS max_followup_id, + sum(l.debit - l.credit) AS balance, + l.company_id company_id + FROM + account_move_line l + LEFT JOIN account_account a ON (l.account_id = a.id) + WHERE + a.active AND + a.type = 'receivable' AND + l.reconcile_id is NULL AND + l.partner_id IS NOT NULL + GROUP BY + l.partner_id, l.company_id + )""") +account_followup_stat_by_partner() + class account_followup_print_all(osv.osv_memory): _name = 'account.followup.print.all' _description = 'Print Followup & Send Mail to Customers' _columns = { - 'partner_ids': fields.many2many('account_followup.stat', 'partner_stat_rel', 'followup_id', 'stat_id', 'Partners', required=True), + 'partner_ids': fields.many2many('account_followup.stat.by.partner', 'partner_stat_rel', 'osv_memory_id', 'partner_id', 'Partners', required=True, domain="[('account_id.type', '=', 'receivable'), ('account_id.reconcile', '=', True), ('reconcile_id','=', False), ('state', '!=', 'draft'), ('account_id.active', '=' True), ('debit', '>', 0)]"), 'email_conf': fields.boolean('Send email confirmation'), 'email_subject': fields.char('Email Subject', size=64), 'partner_lang': fields.boolean('Send Email in Partner Language', help='Do not change message text, if you want to send email in partner language, or configure from company'), @@ -94,7 +135,7 @@ class account_followup_print_all(osv.osv_memory): _defaults = { 'email_body': _get_msg, - 'email_subject': 'Invoices Reminder', + 'email_subject': _('Invoices Reminder'), 'partner_lang': True, 'partner_ids': _get_partners, 'summary': _get_summary, @@ -295,4 +336,4 @@ class account_followup_print_all(osv.osv_memory): account_followup_print_all() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_followup/wizard/account_followup_print_view.xml b/addons/account_followup/wizard/account_followup_print_view.xml index d21a1162a41..f647c569358 100644 --- a/addons/account_followup/wizard/account_followup_print_view.xml +++ b/addons/account_followup/wizard/account_followup_print_view.xml @@ -36,8 +36,38 @@ parent="account.menu_finance_periodical_processing_billing" sequence="10"/> + + account_followup.stat.by.partner.search + account_followup.stat.by.partner + search + + + + + + + + + + + + + account_followup.stat.by.partner.tree + account_followup.stat.by.partner + tree + + + + + + + + + + + account.followup.print.all.form @@ -48,8 +78,8 @@ - - + + From 84576286c30cafbca3f0d40a56ba923a1d276d82 Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Thu, 4 Nov 2010 12:53:19 +0530 Subject: [PATCH 11/11] [FIX] hr_expense: Expenses lines should be sorted by date too lp bug: https://launchpad.net/bugs/616783 fixed bzr revid: mra@mra-laptop-20101104072319-vfwjj4yzfuac7up3 --- addons/hr_expense/hr_expense.py | 2 +- addons/hr_expense/report/hr_expense_report.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/hr_expense/hr_expense.py b/addons/hr_expense/hr_expense.py index e7cff7c6a2f..909b717fe17 100644 --- a/addons/hr_expense/hr_expense.py +++ b/addons/hr_expense/hr_expense.py @@ -243,7 +243,7 @@ class hr_expense_line(osv.osv): 'unit_quantity': 1, 'date_value': time.strftime('%Y-%m-%d'), } - _order = "sequence" + _order = "sequence, date_value desc" def onchange_product_id(self, cr, uid, ids, product_id, uom_id, employee_id, context=None): if context is None: diff --git a/addons/hr_expense/report/hr_expense_report.py b/addons/hr_expense/report/hr_expense_report.py index 1de708d2beb..b50e37b654e 100644 --- a/addons/hr_expense/report/hr_expense_report.py +++ b/addons/hr_expense/report/hr_expense_report.py @@ -120,5 +120,7 @@ class hr_expense_report(osv.osv): s.employee_id ) """) + hr_expense_report() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: