mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[IMP] product_contract: Add posibility to compute date_start of line using confirmation date_start
With these changes, we allow the contract line start date to be computed using the order confirmation date. When the product is configured with any of the options set in contract_start_date_method other than manual, the start date will be calculated based on the established date and the selected period. Additionally, we can force the month in which we will work in case the frequency is yearly, quarterly, or semesterly. Is not added support for daily, weekly or monthlylastday in this commit.
This commit is contained in:
@@ -36,6 +36,19 @@
|
||||
</group>
|
||||
<group>
|
||||
<field name="is_auto_renew" />
|
||||
<field name="contract_start_date_method" required="True" />
|
||||
<field
|
||||
name="force_month_yearly"
|
||||
invisible="contract_start_date_method == 'manual' or recurring_rule_type != 'yearly'"
|
||||
/>
|
||||
<field
|
||||
name="force_month_quarterly"
|
||||
invisible="contract_start_date_method == 'manual' or recurring_rule_type != 'quarterly'"
|
||||
/>
|
||||
<field
|
||||
name="force_month_semesterly"
|
||||
invisible="contract_start_date_method == 'manual' or recurring_rule_type != 'semesterly'"
|
||||
/>
|
||||
</group>
|
||||
<group>
|
||||
<group invisible="is_auto_renew == False">
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
<field name="date_start" required="is_contract" />
|
||||
</group>
|
||||
<group invisible="not is_contract">
|
||||
<field name="date_end" required="is_contract" />
|
||||
<field name="date_end" />
|
||||
</group>
|
||||
<group invisible="not is_contract">
|
||||
<field name="is_auto_renew" />
|
||||
@@ -114,8 +114,13 @@
|
||||
/>
|
||||
<field name="recurring_rule_type" optional="hide" />
|
||||
<field name="recurring_invoicing_type" optional="hide" />
|
||||
<field name="date_start" optional="hide" required="is_contract" />
|
||||
<field name="date_end" required="is_contract" optional="hide" />
|
||||
<field name="contract_start_date_method" column_invisible="1" />
|
||||
<field
|
||||
name="date_start"
|
||||
optional="hide"
|
||||
required="is_contract and contract_start_date_method == 'manual'"
|
||||
/>
|
||||
<field name="date_end" optional="hide" />
|
||||
<field name="is_auto_renew" optional="hide" />
|
||||
<field
|
||||
name="auto_renew_interval"
|
||||
@@ -131,7 +136,6 @@
|
||||
required="is_auto_renew"
|
||||
optional="hide"
|
||||
/>
|
||||
<field name="date_end" column_invisible="parent.is_contract == False" />
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
Reference in New Issue
Block a user