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

property_sheets: generate value accessors for source/destination accounts on default supply

Without these accessors, we have to use constructs like:

    resource.edit(
        default_purchase_supply_line_destination_account='account_module/123'
    )

with the accessors, we can use:

    resource.edit(
        default_purchase_supply_line_destination_account_value=account,
    )

The former is a bit error prone, because typos in the property name
silently create a local propery and typos in the relative URL make a
"broken" relation.
parent ea4debfe
Pipeline #19384 failed with stage
in 0 seconds
...@@ -1045,7 +1045,7 @@ class StandardConfigurationMixin(TestLiveConfiguratorWorkflowMixin): ...@@ -1045,7 +1045,7 @@ class StandardConfigurationMixin(TestLiveConfiguratorWorkflowMixin):
individual_variation_base_category='variation', individual_variation_base_category='variation',
base_contribution='base_amount/taxable', base_contribution='base_amount/taxable',
default_sale_supply_line_base_price=10, default_sale_supply_line_base_price=10,
default_sale_supply_line_source_account=sales_account.getRelativeUrl(), default_sale_supply_line_source_account_value=sales_account,
) )
portal.portal_workflow.doActionFor(resource, 'validate_action') portal.portal_workflow.doActionFor(resource, 'validate_action')
self.tic() self.tic()
...@@ -1053,7 +1053,7 @@ class StandardConfigurationMixin(TestLiveConfiguratorWorkflowMixin): ...@@ -1053,7 +1053,7 @@ class StandardConfigurationMixin(TestLiveConfiguratorWorkflowMixin):
portal_type='Service', portal_type='Service',
title="VAT", title="VAT",
use_value=self.portal.portal_categories.use.trade.tax, use_value=self.portal.portal_categories.use.trade.tax,
default_sale_supply_line_source_account=vat_account.getRelativeUrl(), default_sale_supply_line_source_account_value=vat_account,
) )
portal.portal_workflow.doActionFor(vat_service, 'validate_action') portal.portal_workflow.doActionFor(vat_service, 'validate_action')
...@@ -1483,7 +1483,7 @@ class StandardConfigurationMixin(TestLiveConfiguratorWorkflowMixin): ...@@ -1483,7 +1483,7 @@ class StandardConfigurationMixin(TestLiveConfiguratorWorkflowMixin):
individual_variation_base_category='variation', individual_variation_base_category='variation',
base_contribution='base_amount/taxable', base_contribution='base_amount/taxable',
default_purchase_supply_line_base_price=10, default_purchase_supply_line_base_price=10,
default_purchase_supply_line_destination_account=expense_account.getRelativeUrl(), default_purchase_supply_line_destination_account_value=expense_account,
) )
portal.portal_workflow.doActionFor(resource, 'validate_action') portal.portal_workflow.doActionFor(resource, 'validate_action')
self.tic() self.tic()
...@@ -1491,7 +1491,7 @@ class StandardConfigurationMixin(TestLiveConfiguratorWorkflowMixin): ...@@ -1491,7 +1491,7 @@ class StandardConfigurationMixin(TestLiveConfiguratorWorkflowMixin):
portal_type='Service', portal_type='Service',
title="VAT", title="VAT",
use_value=self.portal.portal_categories.use.trade.tax, use_value=self.portal.portal_categories.use.trade.tax,
default_purchase_supply_line_destination_account=vat_account.getRelativeUrl(), default_purchase_supply_line_destination_account_value=vat_account,
) )
portal.portal_workflow.doActionFor(vat_service, 'validate_action') portal.portal_workflow.doActionFor(vat_service, 'validate_action')
......
...@@ -83,6 +83,7 @@ ...@@ -83,6 +83,7 @@
<string>destination_reference</string> <string>destination_reference</string>
<string>p_variation_base_category_list</string> <string>p_variation_base_category_list</string>
<string>destination_account</string> <string>destination_account</string>
<string>destination_account_value</string>
<string>destination_function</string> <string>destination_function</string>
<string>destination_function_value</string> <string>destination_function_value</string>
<string>destination_function_value_list</string> <string>destination_function_value_list</string>
...@@ -92,6 +93,7 @@ ...@@ -92,6 +93,7 @@
<string>destination_funding_value_list</string> <string>destination_funding_value_list</string>
<string>destination_funding_title</string> <string>destination_funding_title</string>
<string>source_account</string> <string>source_account</string>
<string>source_account_value</string>
<string>source_function</string> <string>source_function</string>
<string>source_function_title</string> <string>source_function_title</string>
<string>source_function_value</string> <string>source_function_value</string>
......
...@@ -83,6 +83,7 @@ ...@@ -83,6 +83,7 @@
<string>destination_reference</string> <string>destination_reference</string>
<string>p_variation_base_category_list</string> <string>p_variation_base_category_list</string>
<string>destination_account</string> <string>destination_account</string>
<string>destination_account_value</string>
<string>destination_function</string> <string>destination_function</string>
<string>destination_function_value</string> <string>destination_function_value</string>
<string>destination_function_value_list</string> <string>destination_function_value_list</string>
......
...@@ -83,6 +83,7 @@ ...@@ -83,6 +83,7 @@
<string>destination_reference</string> <string>destination_reference</string>
<string>p_variation_base_category_list</string> <string>p_variation_base_category_list</string>
<string>source_account</string> <string>source_account</string>
<string>source_account_value</string>
<string>source_function</string> <string>source_function</string>
<string>source_function_value</string> <string>source_function_value</string>
<string>source_function_value_list</string> <string>source_function_value_list</string>
......
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