@@ -12,4 +12,97 @@ action = {
1212}
1313 ]]> </field >
1414 </record >
15+ <record id =" action_server_request_identity_document" model =" ir.actions.server" >
16+ <field name =" model_id" ref =" base.model_res_partner" />
17+ <field name =" state" >code</field >
18+ <field name =" name" >Request Identity Document</field >
19+ <field name =" binding_model_id" ref =" base.model_res_partner" />
20+ <field name =" binding_view_types" >form</field >
21+ <field name =" code" ><![CDATA[
22+ action ={
23+ "type": "ir.actions.act_window",
24+ "res_model": "documents.request_wizard",
25+ "views": [[False, "form"]],
26+ "target": "new",
27+ "context": {
28+ "default_folder_id": env.ref('documents.document_inbox_folder').id,
29+ "default_res_id": record.id,
30+ "default_res_model": env.context.get("default_res_model", False),
31+ "default_name": "Identity Document - " + record.name,
32+ "default_requestee_id": record.id,
33+ "default_partner_id": record.id,
34+ "default_activity_date_deadline_range": 7,
35+ "default_activity_note": "Please provide your identity document for update.",
36+ "default_x_has_chatter_message": True,
37+ },
38+ "name": "New Document Request",
39+ }
40+ ]]> </field >
41+ </record >
42+ <record id =" server_action_update_owner_id" model =" ir.actions.server" >
43+ <field name =" model_id" ref =" equity.model_equity_ubo" />
44+ <field name =" state" >code</field >
45+ <field name =" name" >Update Owner ID</field >
46+ <field name =" code" ><![CDATA[
47+ for ubo in records:
48+ ubo.holder_id['x_id_scan'] = ubo.attachment_ids[-1].datas
49+ ubo.holder_id['x_id_expiration_date'] = ubo.attachment_expiration_date
50+ ubo.holder_id.message_post(
51+ body="The Identity Document Scan changed for this one: ",
52+ attachment_ids=[ubo.attachment_ids[-1].id]
53+ )
54+ action = {
55+ 'type': 'ir.actions.client',
56+ 'tag': 'display_notification',
57+ 'params': {
58+ 'message': "Identity Document updated",
59+ 'type': 'success',
60+ },
61+ }
62+ ]]> </field >
63+ </record >
64+ <record id =" server_action_request_document_with_chatter_message" model =" ir.actions.server" >
65+ <field name =" model_id" ref =" documents.model_documents_request_wizard" />
66+ <field name =" state" >code</field >
67+ <field name =" name" >Request Document with Chatter Message</field >
68+ <field name =" code" ><![CDATA[
69+ doc = record.request_document()
70+ doc['x_is_identity_document_request'] = True
71+ record.partner_id.message_post(body="Document request has been sent")
72+ ]]> </field >
73+ </record >
74+ <record id =" server_action_keep_scan_in_chatter" model =" ir.actions.server" >
75+ <field name =" model_id" ref =" base.model_res_partner" />
76+ <field name =" state" >code</field >
77+ <field name =" name" >Keep Scan in Chatter</field >
78+ <field name =" code" ><![CDATA[
79+ for partner in records:
80+ partner.message_post(
81+ body="The Identity Document Scan changed for this one: ",
82+ attachment_ids=[env['ir.attachment'].create({
83+ 'name': 'Identity Document - ' + record.name + ' - History',
84+ 'datas': record.x_id_scan,
85+ }).id]
86+ )
87+ ]]> </field >
88+ </record >
89+ <record id =" server_action_update_document_partner_identity" model =" ir.actions.server" >
90+ <field name =" model_id" ref =" documents.model_documents_document" />
91+ <field name =" state" >code</field >
92+ <field name =" name" >Update Document Partner ID</field >
93+ <field name =" code" ><![CDATA[
94+ for document in records:
95+ document.partner_id['x_id_scan'] = document.attachment_id.datas
96+ document.partner_id.message_post(
97+ body="The Identity Document Scan changed for this one: ",
98+ attachment_ids=[document.attachment_id.id]
99+ )
100+ action = {
101+ 'view_mode': 'form',
102+ 'res_model': 'res.partner',
103+ 'res_id': document.partner_id.id,
104+ 'type': 'ir.actions.act_window',
105+ }
106+ ]]> </field >
107+ </record >
15108</odoo >
0 commit comments