[FIX] new pep8 and new Travis

This commit is contained in:
Pedro M. Baeza
2015-02-26 20:46:25 +01:00
parent df8e91d594
commit ed06c738ec
4 changed files with 14 additions and 38 deletions

View File

@@ -1,18 +0,0 @@
# Config file .coveragerc
# adapt the include for your project
[report]
include =
*/OCA/stock-logistics-warehouse/*
omit =
*/tests/*
*__init__.py
# Regexes for lines to exclude from consideration
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover
# Don't complain about null context checking
if context is None:

View File

@@ -4,8 +4,9 @@ python:
- "2.7"
env:
- VERSION="7.0" ODOO_REPO="odoo/odoo"
- VERSION="7.0" ODOO_REPO="OCA/OCB"
- VERSION="7.0" LINT_CHECK="1"
- VERSION="7.0" ODOO_REPO="odoo/odoo" LINT_CHECK="0"
- VERSION="7.0" ODOO_REPO="OCA/OCB" LINT_CHECK="0"
virtualenv:
system_site_packages: true
@@ -18,7 +19,6 @@ install:
- git clone https://github.com/OCA/stock-logistics-barcode -b ${VERSION} $HOME/stock-logistics-barcode
script:
- travis_run_flake8
- travis_run_tests
after_success:

View File

@@ -61,10 +61,8 @@ class stock_production_lot(orm.Model):
currency_id = False
if lot.company_id and lot.company_id.currency_id:
currency_id = lot.company_id.currency_id.id
elif (
lot.product_id.company_id
and lot.product_id.company_id.currency_id
):
elif (lot.product_id.company_id and
lot.product_id.company_id.currency_id):
currency_id = lot.product_id.company_id.currency_id.id
if currency_id:
res[lot.id] = self.pool.get('res.currency').compute(
@@ -134,10 +132,8 @@ class stock_production_lot(orm.Model):
# Accounting Entries
#
product = lot.product_id
if (
not journal_id
and product.categ_id.property_stock_journal
):
if (not journal_id and
product.categ_id.property_stock_journal):
journal_id = product.categ_id.property_stock_journal.id
if not journal_id:
raise orm.except_orm(
@@ -287,8 +283,8 @@ class stock_picking(orm.Model):
# Get the standard price
amount_unit = lot.price_get(context=context)[lot.id]
new_std_price = (
((amount_unit * lot.stock_available)
+ (new_price * qty)) / (lot.stock_available + qty)
((amount_unit * lot.stock_available) +
(new_price * qty)) / (lot.stock_available + qty)
)
lot_obj.write(
@@ -323,10 +319,8 @@ class stock_picking(orm.Model):
):
self.compute_price(
cr, uid, partial_datas, move, context=context)
if (
move.product_id.lot_valuation and product_price
and not lot.standard_price
):
if (move.product_id.lot_valuation and product_price and
not lot.standard_price):
new_price = currency_obj.compute(
cr, uid, product_currency,
move.company_id.currency_id.id, product_price)

View File

@@ -39,9 +39,9 @@ class stock_move(orm.Model):
_super = super(stock_move, self)
location = move.location_id
location_dest = move.location_dest_id
if (location.company_id
and location_dest.company_id
and location.company_id != location_dest.company_id):
if (location.company_id and
location_dest.company_id and
location.company_id != location_dest.company_id):
return _super._create_product_valuation_moves(
cr, uid, move, context=context)
if (move.location_id.usage == 'internal' or