[IMP] sale modules : Cleaning modules
authorpso <pso@tinyerp.com>
Mon, 25 Oct 2010 09:24:24 +0000 (14:54 +0530)
committerpso <pso@tinyerp.com>
Mon, 25 Oct 2010 09:24:24 +0000 (14:54 +0530)
bzr revid: pso@tinyerp.com-20101025092424-h4ovhk9oidooby4j

addons/sale_analytic_plans/sale_analytic_plans.py
addons/sale_journal/sale_journal.py
addons/sale_layout/sale_layout.py
addons/sale_margin/sale_margin.py

index 9fffae1..cc006f3 100644 (file)
@@ -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:
index 5e66c74..5434df1 100644 (file)
 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 ##############################################################################
-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'
index 5d3f7d6..e5554ab 100755 (executable)
@@ -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"
index 4ca88f9..2f756d5 100644 (file)
@@ -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: