From e54dbddd6771f28b7c9621891d63455f6e05156c Mon Sep 17 00:00:00 2001 From: pso Date: Mon, 25 Oct 2010 14:54:24 +0530 Subject: [PATCH] [IMP] sale modules : Cleaning modules bzr revid: pso@tinyerp.com-20101025092424-h4ovhk9oidooby4j --- .../sale_analytic_plans.py | 4 +- addons/sale_journal/sale_journal.py | 3 - addons/sale_layout/sale_layout.py | 56 +++++++++---------- addons/sale_margin/sale_margin.py | 4 +- 4 files changed, 30 insertions(+), 37 deletions(-) diff --git a/addons/sale_analytic_plans/sale_analytic_plans.py b/addons/sale_analytic_plans/sale_analytic_plans.py index 9fffae1d74a..cc006f3afc0 100644 --- a/addons/sale_analytic_plans/sale_analytic_plans.py +++ b/addons/sale_analytic_plans/sale_analytic_plans.py @@ -30,7 +30,7 @@ class sale_order_line(osv.osv): if context is None: context = {} line_obj = self.pool.get('account.invoice.line') - create_ids = super(sale_order_line,self).invoice_line_create(cr, uid, ids, context=context) + create_ids = super(sale_order_line, self).invoice_line_create(cr, uid, ids, context=context) i = 0 for line in self.browse(cr, uid, ids, context): line_obj.write(cr, uid, [create_ids[i]], {'analytics_id': line.analytics_id.id}) @@ -39,4 +39,4 @@ class sale_order_line(osv.osv): sale_order_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: diff --git a/addons/sale_journal/sale_journal.py b/addons/sale_journal/sale_journal.py index 5e66c74590b..5434df1725e 100644 --- a/addons/sale_journal/sale_journal.py +++ b/addons/sale_journal/sale_journal.py @@ -18,11 +18,8 @@ # along with this program. If not, see . # ############################################################################## -import time from osv import osv, fields -import netsvc -from tools.translate import _ class sale_journal_invoice_type(osv.osv): _name = 'sale_journal.invoice.type' diff --git a/addons/sale_layout/sale_layout.py b/addons/sale_layout/sale_layout.py index 5d3f7d65f9f..e5554aba07c 100755 --- a/addons/sale_layout/sale_layout.py +++ b/addons/sale_layout/sale_layout.py @@ -26,8 +26,6 @@ import decimal_precision as dp class sale_order_line(osv.osv): def _amount_line(self, cr, uid, ids, field_name, arg, context=None): - tax_obj = self.pool.get('account.tax') - cur_obj = self.pool.get('res.currency') res = {} context = context or {} for line in self.browse(cr, uid, ids, context=context): @@ -51,33 +49,33 @@ class sale_order_line(osv.osv): return invoice_line_ids def onchange_sale_order_line_view(self, cr, uid, id, type, context={}, *args): - temp = {} - temp['value'] = {} - if (not type): - return {} - if type != 'article': - temp = { - 'value': { - 'product_id': False, - 'uos_id': False, - 'account_id': False, - 'price_unit': 0.0, - 'price_subtotal': 0.0, - 'quantity': 0, - 'discount': 0.0, - 'invoice_line_tax_id': False, - 'account_analytic_id': False, - 'product_uom_qty': 0.0, - }, - } - if type == 'line': - temp['value']['name'] = ' ' - if type == 'break': - temp['value']['name'] = ' ' - if type == 'subtotal': - temp['value']['name'] = 'Sub Total' - return temp + temp = {} + temp['value'] = {} + if (not type): return {} + if type != 'article': + temp = { + 'value': { + 'product_id': False, + 'uos_id': False, + 'account_id': False, + 'price_unit': 0.0, + 'price_subtotal': 0.0, + 'quantity': 0, + 'discount': 0.0, + 'invoice_line_tax_id': False, + 'account_analytic_id': False, + 'product_uom_qty': 0.0, + }, + } + if type == 'line': + temp['value']['name'] = ' ' + if type == 'break': + temp['value']['name'] = ' ' + if type == 'subtotal': + temp['value']['name'] = 'Sub Total' + return temp + return {} def create(self, cr, user, vals, context=None): if vals.has_key('layout_type'): @@ -103,8 +101,6 @@ class sale_order_line(osv.osv): default['layout_type'] = self.browse(cr, uid, id).layout_type return super(sale_order_line, self).copy(cr, uid, id, default, context) - - _name = "sale.order.line" _order = "order_id, sequence asc" _description = "Sale Order line" _inherit = "sale.order.line" diff --git a/addons/sale_margin/sale_margin.py b/addons/sale_margin/sale_margin.py index 4ca88f9da19..2f756d5ecda 100644 --- a/addons/sale_margin/sale_margin.py +++ b/addons/sale_margin/sale_margin.py @@ -19,7 +19,6 @@ ############################################################################## from osv import fields, osv -from tools import config class sale_order_line(osv.osv): _inherit = "sale.order.line" @@ -108,4 +107,5 @@ class account_invoice_line(osv.osv): return super(account_invoice_line, self).create(cr, uid, vals, context) account_invoice_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: