Commit 2f143d52 authored by Jérome Perrin's avatar Jérome Perrin

invoicing: fix pylint messages and enable coding style test

parent 680fdcf9
......@@ -4,12 +4,12 @@ if resource is not None:
base_category_list = resource.getVariationBaseCategoryList(omit_optional_variation=1)
for base_category in base_category_list:
if matrixbox == 1:
if matrixbox:
# XXX matrixbox is right_display (not as listfield) => invert display and value in item
cell_range.append( map(lambda x: (x[1],x[0]), context.getVariationCategoryItemList(base_category_list = (base_category,) ) ) )
cell_range.append([(x[1], x[0]) for x in context.getVariationCategoryItemList(base_category_list=(base_category,))])
else:
cell_range.append( context.getVariationCategoryList(base_category_list = (base_category,) ) )
cell_range = filter(lambda x: x != [], cell_range )
cell_range = [x for x in cell_range if x != []]
return cell_range
"""This script is called on the Invoice after the delivery builder has created
the new Invoice.
"""
from Products.ERP5Type.Message import translateString
if related_simulation_movement_path_list is None:
raise RuntimeError, 'related_simulation_movement_path_list is missing. Update ERP5 Product.'
......
......@@ -24,4 +24,4 @@ for movement in movement_list:
if line is not None:
deliveries_keys[line.getExplanationValue()] = 1
return filter(lambda x : x is not None, deliveries_keys.keys())
return [x for x in deliveries_keys.keys() if x is not None]
......@@ -17,14 +17,8 @@ def recursiveCopyLine(to_document, from_document):
recursiveCopyLine(reverse_line, line)
newCell = reverse_line.newContent
for cell in line.objectValues(portal_type='Invoice Cell'):
raise NotImplementedError
newCell(
# TODO: what properties ?
portal_type=cell.getPortalType(),
category_list=cell.getCategoryList(),
)
raise NotImplementedError("NotImplemented: Should do something with %s and %s" % (cell, newCell))
portal = context.getPortalObject()
reverse_invoice = context.getParentValue().newContent(
portal_type=context.getPortalType(),
created_by_builder=1, # tell init script to not create lines
......
......@@ -7,7 +7,7 @@ def getSourceReference(line):
for predicate in predicate_list:
source_reference = predicate.getSourceReference()
if source_reference:
return source_reference
return source_reference
return ''
def getDestinationReference(line):
......@@ -19,7 +19,7 @@ def getDestinationReference(line):
for predicate in predicate_list:
destination_reference = predicate.getDestinationReference()
if destination_reference:
return destination_reference
return destination_reference
return ''
#if context.getPortalType() in context.getPortalSaleTypeList():
......
......@@ -2,5 +2,7 @@
If the business template 'erp5_advanced_invoicing' is installed, returns True.
If it is not, returns False.
"""
business_template_list = context.portal_templates.getInstalledBusinessTemplateList()
return filter(lambda x: x.getTitle() == "erp5_advanced_invoicing", business_template_list, False)
for bt in context.portal_templates.getInstalledBusinessTemplateList():
if bt.getTitle() == "erp5_advanced_invoicing":
return True
return False
# This script uses format= argument
# pylint: disable=redefined-builtin
if target_language:
container.REQUEST['AcceptLanguage'].set(target_language, 10)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment