mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[IMP] - Create contract on sale order confirmation
- On Sale Order confirmation, a contract is created for each contract template used on sale order lines - A not finished contract can be mentioned on sale order line - A sale order line linked to a contract will update it and don't create a new one if it had the same template
This commit is contained in:
@@ -12,9 +12,27 @@
|
||||
<field name="model">sale.order</field>
|
||||
<field name="inherit_id" ref="sale.view_order_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//div[@name='button_box']" position="inside">
|
||||
<button name="action_show_contracts"
|
||||
type="object" icon="fa-book"
|
||||
class="oe_stat_button"
|
||||
attrs="{'invisible': ['|', ('is_contract', '!=', True), ('state', 'not in', ['sale', 'done'])]}">
|
||||
<field string="Contracts"
|
||||
name="contract_count"
|
||||
widget="statinfo"/>
|
||||
</button>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='order_line']" position="before">
|
||||
<field name="is_contract" invisible="1"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='order_line']/form//field[@name='product_id']"
|
||||
position="after">
|
||||
<field name="contract_template_id" invisible="1"/>
|
||||
<field name="contract_id"
|
||||
attrs="{'invisible': [('is_contract', '=', False)]}"
|
||||
domain="[('partner_id','=',parent.partner_id),('contract_template_id','=',contract_template_id)]"
|
||||
/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='order_line']/form//field[@name='tax_id']/parent::group"
|
||||
position="after">
|
||||
<separator colspan="4" string="Recurrence Invoicing"
|
||||
|
||||
Reference in New Issue
Block a user