Commit dc0ba369 authored by Jérome Perrin's avatar Jérome Perrin

initialize membership criterion base category list on budget line


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26101 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 967d1392
...@@ -152,16 +152,27 @@ class CategoryBudgetVariation(BudgetVariation): ...@@ -152,16 +152,27 @@ class CategoryBudgetVariation(BudgetVariation):
""" """
budget_line_variation_category_list =\ budget_line_variation_category_list =\
list(budget_line.getVariationBaseCategoryList() or []) list(budget_line.getVariationBaseCategoryList() or [])
budget_line_membership_criterion_base_category_list =\
list(budget_line.getMembershipCriterionBaseCategoryList() or [])
base_category = self.getProperty('variation_base_category') base_category = self.getProperty('variation_base_category')
if base_category: if base_category:
budget_line_variation_category_list.append(base_category) budget_line_variation_category_list.append(base_category)
budget_line.setVariationBaseCategoryList( budget_line.setVariationBaseCategoryList(
budget_line_variation_category_list) budget_line_variation_category_list)
if self.isMemberOf('budget_variation/budget_line'):
budget_line_membership_criterion_base_category_list.append(base_category)
budget_line.setMembershipCriterionBaseCategoryList(
budget_line_membership_criterion_base_category_list)
def initializeBudget(self, budget): def initializeBudget(self, budget):
"""Initialize a budget. """Initialize a budget.
""" """
# same as budget line budget_variation_category_list =\
return self.initializeBudgetLine(budget) list(budget.getVariationBaseCategoryList() or [])
base_category = self.getProperty('variation_base_category')
if base_category:
budget_variation_category_list.append(base_category)
budget.setVariationBaseCategoryList(
budget_variation_category_list)
...@@ -146,16 +146,27 @@ class NodeBudgetVariation(BudgetVariation): ...@@ -146,16 +146,27 @@ class NodeBudgetVariation(BudgetVariation):
""" """
budget_line_variation_category_list =\ budget_line_variation_category_list =\
list(budget_line.getVariationBaseCategoryList() or []) list(budget_line.getVariationBaseCategoryList() or [])
budget_line_membership_criterion_base_category_list =\
list(budget_line.getMembershipCriterionBaseCategoryList() or [])
base_category = self.getProperty('variation_base_category') base_category = self.getProperty('variation_base_category')
if base_category: if base_category:
budget_line_variation_category_list.append(base_category) budget_line_variation_category_list.append(base_category)
budget_line.setVariationBaseCategoryList( budget_line.setVariationBaseCategoryList(
budget_line_variation_category_list) budget_line_variation_category_list)
if self.isMemberOf('budget_variation/budget_line'):
budget_line_membership_criterion_base_category_list.append(base_category)
budget_line.setMembershipCriterionBaseCategoryList(
budget_line_membership_criterion_base_category_list)
def initializeBudget(self, budget): def initializeBudget(self, budget):
"""Initialize a budget. """Initialize a budget.
""" """
# same as budget line budget_variation_category_list =\
return self.initializeBudgetLine(budget) list(budget.getVariationBaseCategoryList() or [])
base_category = self.getProperty('variation_base_category')
if base_category:
budget_variation_category_list.append(base_category)
budget.setVariationBaseCategoryList(
budget_variation_category_list)
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