Reviewers: ,


Please review this at http://codereview.tryton.org/164008/

Affected files:
  M inventory.py
  M move.py
  M product.py
  M shipment.py
  M tests/test_stock.py


Index: inventory.py
===================================================================

--- a/inventory.py
+++ b/inventory.py
@@ -91,7 +91,6 @@
             })

     def wkf_done(self, inventory):
-        date_obj = Pool().get('ir.date')
         line_obj = Pool().get('stock.inventory.line')

         for line in inventory.lines:
@@ -140,7 +139,6 @@
         pool = Pool()
         line_obj = pool.get('stock.inventory.line')
         product_obj = pool.get('product.product')
-        uom_obj = pool.get('product.uom')

         if isinstance(ids, (int, long)):
             ids = [ids]
@@ -227,7 +225,6 @@

     def on_change_product(self, vals):
         product_obj = Pool().get('product.product')
-        uom_obj = Pool().get('product.uom')
         res = {}
         res['unit_digits'] = 2
         if vals.get('product'):

Index: move.py
===================================================================

--- a/move.py
+++ b/move.py
@@ -259,7 +259,6 @@

     def default_currency(self):
         company_obj = Pool().get('company.company')
-        currency_obj = Pool().get('currency.currency')
         company = Transaction().context.get('company')
         if company:
             company = company_obj.browse(company)
@@ -725,7 +724,7 @@
                     self.write(move.id, values)
                     first = False
                 else:
-                    move_id = self.copy(move.id, default=values)
+                    self.copy(move.id, default=values)

                 qty_default_uom = uom_obj.compute_qty(move.uom, qty,
                         move.product.default_uom, round=False)

Index: product.py
===================================================================

--- a/product.py
+++ b/product.py
@@ -169,8 +169,6 @@
                 and quantity as value
         """
         pool = Pool()
-        uom_obj = pool.get("product.uom")
-        product_obj = pool.get("product.product")
         rule_obj = pool.get('ir.rule')
         location_obj = pool.get('stock.location')
         date_obj = pool.get('ir.date')

Index: shipment.py
===================================================================

--- a/shipment.py
+++ b/shipment.py
@@ -1048,7 +1048,6 @@
         that are in the outgoing moves.
         """
         move_obj = Pool().get('stock.move')
-        uom_obj = Pool().get('product.uom')
         self.write(shipment.id, {
             'state': 'waiting',
             })
@@ -1311,7 +1310,6 @@
             return {'delivery_address': False}
         party_obj = Pool().get("party.party")
address_id = party_obj.address_get(values['customer'], type='delivery')
-        party = party_obj.browse(values['customer'])
         return {
                 'delivery_address': address_id,
             }
@@ -2109,9 +2107,6 @@
     _name = 'stock.shipment.out.picking_list'

     def parse(self, report, objects, datas, localcontext):
-        move_obj = Pool().get('stock.move')
-        shipment_out_obj = Pool().get('stock.shipment.out')
-
         compare_context = self.get_compare_context(report, objects, datas)

         sorted_moves = {}
@@ -2156,9 +2151,6 @@
     _name = 'stock.shipment.in.restocking_list'

     def parse(self, report, objects, datas, localcontext):
-        move_obj = Pool().get('stock.move')
-        shipment_in_obj = Pool().get('stock.shipment.in')
-
         compare_context = self.get_compare_context(report, objects, datas)

         sorted_moves = {}
@@ -2203,9 +2195,6 @@
     _name = 'stock.shipment.out.return.restocking_list'

     def parse(self, report, objects, datas, localcontext):
-        move_obj = Pool().get('stock.move')
-        shipment_in_obj = Pool().get('stock.shipment.out.return')
-
         compare_context = self.get_compare_context(report, objects, datas)

         sorted_moves = {}
@@ -2250,9 +2239,6 @@
     _name = 'stock.shipment.internal.report'

     def parse(self, report, objects, datas, localcontext=None):
-        move_obj = Pool().get('stock.move')
-        shipment_in_obj = Pool().get('stock.shipment.internal')
-
         compare_context = self.get_compare_context(report, objects, datas)

         sorted_moves = {}

Index: tests/test_stock.py
===================================================================

--- a/tests/test_stock.py
+++ b/tests/test_stock.py
@@ -52,7 +52,7 @@
         '''
         Test Move.internal_quantity.
         '''
-        with Transaction().start(DB_NAME, USER, CONTEXT) as transaction:
+        with Transaction().start(DB_NAME, USER, CONTEXT):
             category_id = self.category.create({
                 'name': 'Test Move.internal_quantity',
                 })
@@ -301,7 +301,7 @@
         '''
         Test period.
         '''
-        with Transaction().start(DB_NAME, USER, CONTEXT) as transaction:
+        with Transaction().start(DB_NAME, USER, CONTEXT):
             category_id = self.category.create({
                 'name': 'Test period',
                 })



--
[email protected] mailing list

Reply via email to