From fe565b9f0ae522515b338405253d75e3fccc943d Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Wed, 26 Nov 2008 14:40:48 +0100 Subject: [PATCH 1/3] [FIX] Add the module 'stock' in the dependencies of stock_invoice_directly bzr revid: stephane@tinyerp.com-20081126134048-sgx7ia94v3bks1dd --- addons/stock_invoice_directly/__terp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock_invoice_directly/__terp__.py b/addons/stock_invoice_directly/__terp__.py index 112f720fb88..3057a411c9f 100644 --- a/addons/stock_invoice_directly/__terp__.py +++ b/addons/stock_invoice_directly/__terp__.py @@ -24,7 +24,7 @@ "version" : "1.0", "author" : "Tiny", "website" : "http://tinyerp.com/module_sale.html", - "depends" : ["delivery"], + "depends" : ["delivery", "stock"], "category" : "Generic Modules/Sales & Purchases", "description": """ When you send or deliver goods, this module automatically launch From 26a3a70ab101e83ac8fb94e6338d2f21bcea5b8c Mon Sep 17 00:00:00 2001 From: qdp Date: Wed, 26 Nov 2008 14:48:24 +0100 Subject: [PATCH 2/3] *added a hook at the end of default_get on account_move_line manual entry by account_move form, in order to be able to inherit it in other modules (like acount_analytic_plans) *minor bugfix: error occured when tax had no account_account specified bzr revid: qdp@tinyerp.com-20081126134824-qf7msdiuze9hqv0r --- addons/account/account_move_line.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index feda9b9a1e0..547fd89d7c7 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -76,6 +76,14 @@ class account_move_line(osv.osv): new_id = self.pool.get('account.analytic.line').create(cr,uid,vals_lines) return True + def _default_get_move_form_hook(self, cursor, user, data): + '''Called in the end of default_get method for manual entry in account_move form''' + if data.has_key('analytic_account_id'): + del(data['analytic_account_id']) + if data.has_key('account_tax_id'): + del(data['account_tax_id']) + return data + def _default_get(self, cr, uid, fields, context={}): # Compute simple values data = super(account_move_line, self).default_get(cr, uid, fields, context) @@ -104,8 +112,7 @@ class account_move_line(osv.osv): s = -total_new data['debit'] = s>0 and s or 0.0 data['credit'] = s<0 and -s or 0.0 - del(data['analytic_account_id']) - del(data['account_tax_id']) + data = self._default_get_move_form_hook(cr, uid, data) return data # Ends: Manual entry from account.move form @@ -883,7 +890,7 @@ class account_move_line(osv.osv): 'account_tax_id': False, 'tax_code_id': tax[tax_code], 'tax_amount': tax[tax_sign] * abs(tax['amount']), - 'account_id': tax[account_id], + 'account_id': tax[account_id] or vals['account_id'], 'credit': tax['amount']<0 and -tax['amount'] or 0.0, 'debit': tax['amount']>0 and tax['amount'] or 0.0, } From 171dafba36e287c513f000466ba55c8ccc33e3ae Mon Sep 17 00:00:00 2001 From: qdp Date: Wed, 26 Nov 2008 16:39:39 +0100 Subject: [PATCH 3/3] *removed account_tax_id field from account_move_form view bzr revid: qdp@tinyerp.com-20081126153939-9hdntnkpfoh3jlqb --- addons/account/account_view.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index e66115f1f57..c64eff8a8d8 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -857,7 +857,6 @@ -