Fix pep8 and pyflakes

This commit is contained in:
Cédric Krier
2012-04-03 20:07:41 +02:00
parent cb69b5d1ba
commit 5345defdfc
4 changed files with 14 additions and 10 deletions
+5 -5
View File
@@ -2,12 +2,12 @@
#This file is part of Tryton. The COPYRIGHT file at the top level of
#this repository contains the full copyright notices and license terms.
{
'name' : 'Sale Shipment Cost',
'name': 'Sale Shipment Cost',
'name_de_DE': 'Verkauf Lieferposten Kosten',
'name_es_ES': 'Costo del método de envio',
'name_fr_FR': "Coût d'expédition de vente",
'version' : '2.3.0',
'author' : 'B2CK',
'version': '2.3.0',
'author': 'B2CK',
'email': 'info@b2ck.com',
'website': 'http://www.tryton.org/',
'description': 'Add sale shipment cost',
@@ -16,7 +16,7 @@
''',
'description_fr_FR': "Ajoute le coût d'expédition sur les ventes",
'description_es_ES': "Agrega un costo al método de envio.",
'depends' : [
'depends': [
'ir',
'res',
'carrier',
@@ -25,7 +25,7 @@
'account_invoice',
'stock',
],
'xml' : [
'xml': [
'sale.xml',
'stock.xml',
],
+4 -3
View File
@@ -124,13 +124,13 @@ class Sale(Model):
'type': 'line',
'product': product.id,
'description': description,
'quantity': 1, #XXX
'quantity': 1, # XXX
'unit': product.sale_uom.id,
'unit_price': cost,
'shipment_cost': cost,
'amount': cost,
'taxes': taxes,
'sequence': 9999, #XXX
'sequence': 9999, # XXX
}
pattern = sale_line_obj._get_tax_rule_pattern(party,
cost_line)
@@ -191,7 +191,8 @@ class Sale(Model):
shipment_obj.get_carrier_context(shipment, values={
'carrier': sale.carrier.id,
})):
cost, currency_id = carrier_obj.get_sale_price(sale.carrier)
cost, currency_id = carrier_obj.get_sale_price(
sale.carrier)
with Transaction().set_user(0, set_context=True):
shipment_obj.write(shipment.id, {
'carrier': sale.carrier.id,
+1 -1
View File
@@ -130,7 +130,7 @@ class ShipmentOut(Model):
with Transaction().set_context(party_context):
values['description'] = product_obj.browse(product.id).rec_name
values['quantity'] = 1 # XXX
values['quantity'] = 1 # XXX
values['unit'] = product.sale_uom.id
cost = shipment.cost
if invoice.currency != shipment.cost_currency:
+4 -1
View File
@@ -1,7 +1,8 @@
#!/usr/bin/env python
#This file is part of Tryton. The COPYRIGHT file at the top level of
#this repository contains the full copyright notices and license terms.
import sys, os
import sys
import os
DIR = os.path.abspath(os.path.normpath(os.path.join(__file__,
'..', '..', '..', '..', '..', 'trytond')))
if os.path.isdir(DIR):
@@ -34,6 +35,7 @@ class SaleShipmentCostTestCase(unittest.TestCase):
'''
test_depends()
def doctest_dropdb(test):
'''
Remove sqlite memory database
@@ -46,6 +48,7 @@ def doctest_dropdb(test):
finally:
cursor.close()
def suite():
suite = trytond.tests.test_tryton.suite()
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(