From b68de7b535345d61b12ed051a575852921291c60 Mon Sep 17 00:00:00 2001 From: Lorenzo Battistini Date: Tue, 18 Jun 2013 21:37:05 +0200 Subject: [PATCH] [fix] prefer the form `... if ... else ...` than `... and ... or ...` --- stock_lot_valuation/stock.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/stock_lot_valuation/stock.py b/stock_lot_valuation/stock.py index 46c7ee3da..81efc767e 100644 --- a/stock_lot_valuation/stock.py +++ b/stock_lot_valuation/stock.py @@ -112,10 +112,8 @@ class stock_production_lot(orm.Model): # Accounting Entries # product = lot.product_id - if not journal_id: - journal_id = (product.categ_id.property_stock_journal - and product.categ_id.property_stock_journal.id - or False) + 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 osv.except_osv(_('Error!'), _("Please define journal "