Initial commit
This commit is contained in:
30
fusion_claims/data/ir_actions_server_data.xml
Normal file
30
fusion_claims/data/ir_actions_server_data.xml
Normal file
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<!-- Server Action: Sync ADP Fields to Invoices -->
|
||||
<!-- This appears in the Action menu on Sale Orders -->
|
||||
<record id="action_sync_adp_fields_server" model="ir.actions.server">
|
||||
<field name="name">Sync to Invoices</field>
|
||||
<field name="model_id" ref="sale.model_sale_order"/>
|
||||
<field name="binding_model_id" ref="sale.model_sale_order"/>
|
||||
<field name="binding_view_types">form,list</field>
|
||||
<field name="state">code</field>
|
||||
<field name="code">
|
||||
if records:
|
||||
# Filter to only ADP sales
|
||||
adp_records = records.filtered(lambda r: r.x_fc_is_adp_sale and r.state == 'sale')
|
||||
if adp_records:
|
||||
action = adp_records.action_sync_adp_fields()
|
||||
else:
|
||||
action = {
|
||||
'type': 'ir.actions.client',
|
||||
'tag': 'display_notification',
|
||||
'params': {
|
||||
'title': 'No ADP Sales',
|
||||
'message': 'Selected orders are not confirmed ADP sales.',
|
||||
'type': 'warning',
|
||||
'sticky': False,
|
||||
}
|
||||
}
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user