Commit 4ee585d8 authored by Arnaud Fontaine's avatar Arnaud Fontaine

ERP5/Document: Fix pylint warnings.

parent d672defe
...@@ -35,7 +35,6 @@ from AccessControl.PermissionRole import PermissionRole ...@@ -35,7 +35,6 @@ from AccessControl.PermissionRole import PermissionRole
from Products.ERP5Type import Permissions, PropertySheet, interfaces from Products.ERP5Type import Permissions, PropertySheet, interfaces
from Products.ERP5.Document.OrderLine import OrderLine
from Products.ERP5.Document.Movement import Movement from Products.ERP5.Document.Movement import Movement
from Products.ERP5.Document.MappedValue import MappedValue from Products.ERP5.Document.MappedValue import MappedValue
from Products.ERP5.Document.ImmobilisationMovement import ImmobilisationMovement from Products.ERP5.Document.ImmobilisationMovement import ImmobilisationMovement
...@@ -45,7 +44,6 @@ class DeliveryCell(MappedValue, Movement, ImmobilisationMovement): ...@@ -45,7 +44,6 @@ class DeliveryCell(MappedValue, Movement, ImmobilisationMovement):
A DeliveryCell allows to define specific quantities A DeliveryCell allows to define specific quantities
for each variation of a resource in a delivery line. for each variation of a resource in a delivery line.
""" """
meta_type = 'ERP5 Delivery Cell' meta_type = 'ERP5 Delivery Cell'
portal_type = 'Delivery Cell' portal_type = 'Delivery Cell'
isCell = 1 isCell = 1
...@@ -117,16 +115,14 @@ class DeliveryCell(MappedValue, Movement, ImmobilisationMovement): ...@@ -117,16 +115,14 @@ class DeliveryCell(MappedValue, Movement, ImmobilisationMovement):
security.declareProtected( Permissions.ModifyPortalContent, security.declareProtected( Permissions.ModifyPortalContent,
'notifyAfterUpdateRelatedContent' ) 'notifyAfterUpdateRelatedContent' )
def notifyAfterUpdateRelatedContent(self, previous_category_url, def notifyAfterUpdateRelatedContent(self, previous_category_url, new_category_url):
new_category_url):
""" """
Membership Crirerions and Category List are same in DeliveryCell Membership Crirerions and Category List are same in DeliveryCell
Must update it (or change implementation to remove data duplication) Must update it (or change implementation to remove data duplication)
""" """
update_method = self.portal_categories.updateRelatedCategory update_method = self.portal_categories.updateRelatedCategory
predicate_value = self.getPredicateValueList() new_predicate_value = [update_method(c, previous_category_url, new_category_url)
new_predicate_value = map(lambda c: update_method(c, for c in self.getPredicateValueList()]
previous_category_url, new_category_url), predicate_value)
self._setPredicateValueList(new_predicate_value) self._setPredicateValueList(new_predicate_value)
# No reindex needed since uid stable # No reindex needed since uid stable
......
...@@ -48,7 +48,6 @@ class DeliveryLine(Movement, XMLMatrix, ImmobilisationMovement): ...@@ -48,7 +48,6 @@ class DeliveryLine(Movement, XMLMatrix, ImmobilisationMovement):
It may include a price (for insurance, for customs, for invoices, It may include a price (for insurance, for customs, for invoices,
for orders) for orders)
""" """
meta_type = 'ERP5 Delivery Line' meta_type = 'ERP5 Delivery Line'
portal_type = 'Delivery Line' portal_type = 'Delivery Line'
...@@ -152,7 +151,6 @@ class DeliveryLine(Movement, XMLMatrix, ImmobilisationMovement): ...@@ -152,7 +151,6 @@ class DeliveryLine(Movement, XMLMatrix, ImmobilisationMovement):
else: return quantity else: return quantity
if fast argument is true, inventory API will be used. if fast argument is true, inventory API will be used.
""" """
if fast: if fast:
kw = {} kw = {}
kw['section_uid'] = self.getDestinationSectionUid() kw['section_uid'] = self.getDestinationSectionUid()
...@@ -404,8 +402,6 @@ class DeliveryLine(Movement, XMLMatrix, ImmobilisationMovement): ...@@ -404,8 +402,6 @@ class DeliveryLine(Movement, XMLMatrix, ImmobilisationMovement):
raise ValueError('No builder found') raise ValueError('No builder found')
self.edit(quantity=0) # adoption have to 'rebuild' delivery line self.edit(quantity=0) # adoption have to 'rebuild' delivery line
movement_type_list = (delivery_builder.getDeliveryLinePortalType(),
delivery_builder.getDeliveryCellPortalType())
# Collect # Collect
root_group_node = delivery_builder.collectMovement( root_group_node = delivery_builder.collectMovement(
simulation_movement_list) simulation_movement_list)
...@@ -476,7 +472,6 @@ class DeliveryLine(Movement, XMLMatrix, ImmobilisationMovement): ...@@ -476,7 +472,6 @@ class DeliveryLine(Movement, XMLMatrix, ImmobilisationMovement):
""" """
simulation_tool = self.getPortalObject().portal_simulation simulation_tool = self.getPortalObject().portal_simulation
solveMovement = simulation_tool.solveMovement solveMovement = simulation_tool.solveMovement
solve_result_list = []
# accept + split # accept + split
for decision in [q for q in decision_list if q.decision != 'adopt']: for decision in [q for q in decision_list if q.decision != 'adopt']:
if decision.decision == 'accept': if decision.decision == 'accept':
......
...@@ -34,13 +34,11 @@ from Products.ERP5Type.Accessor.Constant import PropertyGetter as ConstantGetter ...@@ -34,13 +34,11 @@ from Products.ERP5Type.Accessor.Constant import PropertyGetter as ConstantGetter
from Products.ERP5.Document.DeliveryCell import DeliveryCell from Products.ERP5.Document.DeliveryCell import DeliveryCell
class InventoryCell(DeliveryCell): class InventoryCell(DeliveryCell):
""" """
An InventoryCell allows to define specific inventory An InventoryCell allows to define specific inventory
for each variation of a resource in an inventory line. for each variation of a resource in an inventory line.
""" """
meta_type = 'ERP5 Inventory Cell' meta_type = 'ERP5 Inventory Cell'
portal_type = 'Inventory Cell' portal_type = 'Inventory Cell'
add_permission = Permissions.AddPortalContent add_permission = Permissions.AddPortalContent
......
...@@ -39,7 +39,6 @@ class InventoryLine(DeliveryLine): ...@@ -39,7 +39,6 @@ class InventoryLine(DeliveryLine):
""" """
An Inventory Line describe the inventory of a resource, by variations. An Inventory Line describe the inventory of a resource, by variations.
""" """
meta_type = 'ERP5 Inventory Line' meta_type = 'ERP5 Inventory Line'
portal_type = 'Inventory Line' portal_type = 'Inventory Line'
add_permission = Permissions.AddPortalContent add_permission = Permissions.AddPortalContent
...@@ -62,7 +61,6 @@ class InventoryLine(DeliveryLine): ...@@ -62,7 +61,6 @@ class InventoryLine(DeliveryLine):
, PropertySheet.ItemAggregation , PropertySheet.ItemAggregation
) )
security.declareProtected(Permissions.AccessContentsInformation, 'getTotalInventory') security.declareProtected(Permissions.AccessContentsInformation, 'getTotalInventory')
def getTotalInventory(self): def getTotalInventory(self):
""" """
......
...@@ -37,7 +37,6 @@ class OrderCell(DeliveryCell): ...@@ -37,7 +37,6 @@ class OrderCell(DeliveryCell):
A OrderCell allows to define specific quantities A OrderCell allows to define specific quantities
for each variation of a resource in a delivery line. for each variation of a resource in a delivery line.
""" """
meta_type = 'ERP5 Order Cell' meta_type = 'ERP5 Order Cell'
portal_type = 'Order Cell' portal_type = 'Order Cell'
isCell = 1 isCell = 1
...@@ -88,4 +87,3 @@ class OrderCell(DeliveryCell): ...@@ -88,4 +87,3 @@ class OrderCell(DeliveryCell):
if not self.isMovement(): if not self.isMovement():
return default return default
return DeliveryCell.getTotalQuantity(self, default=default, *args, **kw) return DeliveryCell.getTotalQuantity(self, default=default, *args, **kw)
\ No newline at end of file
...@@ -35,7 +35,6 @@ class OrderLine(DeliveryLine): ...@@ -35,7 +35,6 @@ class OrderLine(DeliveryLine):
""" """
A order line defines quantity and price A order line defines quantity and price
""" """
meta_type = 'ERP5 Order Line' meta_type = 'ERP5 Order Line'
portal_type = 'Order Line' portal_type = 'Order Line'
......
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