fix pyflake errors

review164008
This commit is contained in:
Nicolas Évrard
2011-11-02 16:13:35 +01:00
parent 9b49174e71
commit f6b35baa82
5 changed files with 3 additions and 23 deletions
-3
View File
@@ -91,7 +91,6 @@ class Inventory(ModelWorkflow, ModelSQL, ModelView):
})
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 @@ class Inventory(ModelWorkflow, ModelSQL, ModelView):
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 @@ class InventoryLine(ModelSQL, ModelView):
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'):
+1 -2
View File
@@ -259,7 +259,6 @@ class Move(ModelSQL, ModelView):
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 @@ class Move(ModelSQL, ModelView):
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)
-2
View File
@@ -169,8 +169,6 @@ class Product(ModelSQL, ModelView):
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')
-14
View File
@@ -1048,7 +1048,6 @@ class ShipmentOut(ModelWorkflow, ModelSQL, ModelView):
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 @@ class ShipmentOutReturn(ModelWorkflow, ModelSQL, ModelView):
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 @@ class PickingList(CompanyReport):
_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 @@ class SupplierRestockingList(CompanyReport):
_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 @@ class CustomerReturnRestockingList(CompanyReport):
_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 @@ class InteralShipmentReport(CompanyReport):
_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 = {}
+2 -2
View File
@@ -52,7 +52,7 @@ class StockTestCase(unittest.TestCase):
'''
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 @@ class StockTestCase(unittest.TestCase):
'''
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',
})