Skip to content

Commit 18397e7

Browse files
committed
[FIX] accounting_firm: fix review 14/10
1 parent 0d5f42e commit 18397e7

File tree

9 files changed

+111
-19
lines changed

9 files changed

+111
-19
lines changed

accounting_firm/__manifest__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
'data/sale_order_template_line.xml',
4747
],
4848
'demo': [
49+
'demo/x_mandate.xml',
4950
'demo/res_partner.xml',
5051
'demo/crm_lead.xml',
5152
'demo/equity_ubo.xml',

accounting_firm/data/ir_actions_server.xml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@ action ={
3333
"default_partner_id": record.id,
3434
"default_activity_date_deadline_range": 7,
3535
"default_activity_note": "Please provide your identity document for update.",
36+
"default_x_has_chatter_message": True,
3637
},
3738
"name": "New Document Request",
3839
}
39-
]]></field>
40+
]]></field>
4041
</record>
4142
<record id="server_action_update_owner_id" model="ir.actions.server">
4243
<field name="model_id" ref="equity.model_equity_ubo"/>
@@ -46,6 +47,24 @@ action ={
4647
for ubo in records.filtered('attachment_ids'):
4748
ubo.holder_id['x_id_scan'] = ubo.attachment_ids[-1].datas
4849
ubo.holder_id['x_id_expiration_date'] = ubo.attachment_expiration_date
49-
]]></field>
50+
action = {
51+
'type': 'ir.actions.client',
52+
'tag': 'display_notification',
53+
'params': {
54+
'message': "Identity Document updated",
55+
'type': 'success',
56+
},
57+
}
58+
]]></field>
59+
</record>
60+
<record id="server_action_request_document_with_chatter_message" model="ir.actions.server">
61+
<field name="model_id" ref="documents.model_documents_request_wizard"/>
62+
<field name="state">code</field>
63+
<field name="name">Request Document with Chatter Message</field>
64+
<field name="code"><![CDATA[
65+
doc = record.request_document()
66+
doc['x_is_identity_document_request'] = True
67+
record.partner_id.message_post(body="Document request has been sent")
68+
]]></field>
5069
</record>
5170
</odoo>

accounting_firm/data/ir_cron.xml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
11
<?xml version='1.0' encoding='UTF-8'?>
22
<odoo>
3-
<record id="ir_cron_request_guest_id_document" model="ir.cron">
4-
<field name="name">Accounting Firm: Request Guest Identity Document</field>
3+
<record id="ir_cron_request_contact_id_document" model="ir.cron">
4+
<field name="name">Accounting Firm: Request Contact Identity Document</field>
55
<field name="interval_number">1</field>
66
<field name="interval_type">days</field>
77
<field name="model_id" ref="base.model_res_partner"/>
88
<field name="state">code</field>
99
<field name="code"><![CDATA[
1010
for contact in model.search([('x_id_expiration_date', '!=', False)]):
11-
if contact.x_id_expiration_date < datetime.datetime.today().date() + dateutil.relativedelta.relativedelta(days=7):
12-
action_send_doc_request = env['ir.actions.server'].browse(env.ref('accounting_firm.action_server_request_identity_document').id)
13-
action_send_doc_request.with_context(active_id=contact.id, active_model="res.partner").run()
11+
if contact.x_id_expiration_date < datetime.datetime.today().date() + dateutil.relativedelta.relativedelta(days=7) and not env['documents.document'].search_count([('partner_id', '=', contact.id), ('x_is_identity_document_request', '!=', False), ('attachment_id', '=', False)]):
12+
doc = env['documents.request_wizard'].create({
13+
"folder_id": 2,
14+
"res_id": contact.id or False,
15+
"res_model": env.context.get("default_res_model", False),
16+
"name": "Identity Document " + contact.name,
17+
"requestee_id": contact.id,
18+
"partner_id": contact.id,
19+
"activity_date_deadline_range": 7,
20+
"activity_note": "Please provide your identity document for update.",
21+
}).request_document()
22+
doc['x_is_identity_document_request'] = True
23+
contact.message_post(body="Document request has been sent")
1424
]]></field>
1525
</record>
1626
</odoo>

accounting_firm/data/ir_model_fields.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@
233233
<field name="model_id" ref="base.model_res_partner"/>
234234
<field name="ttype">many2many</field>
235235
<field name="relation">x_mandate</field>
236+
<field name="help">Online platform mandates you have for this customer</field>
236237
</record>
237238

238239
<!-- Mandate fields -->
@@ -288,4 +289,20 @@
288289
<field name="relation">res.partner</field>
289290
<field name="relation_table">x_project_project_res_partner_reviewer_rel</field>
290291
</record>
292+
293+
<!-- Documents Request Wizard -->
294+
<record id="x_has_chatter_message_field_documents_request_wizard" model="ir.model.fields">
295+
<field name="name">x_has_chatter_message</field>
296+
<field name="field_description">Chatter Message</field>
297+
<field name="model_id" ref="documents.model_documents_request_wizard"/>
298+
<field name="ttype">boolean</field>
299+
</record>
300+
301+
<!-- Documents Document -->
302+
<record id="x_is_identity_document_request_field_documents_request_wizard" model="ir.model.fields">
303+
<field name="name">x_is_identity_document_request</field>
304+
<field name="field_description">Is Identity Document Request</field>
305+
<field name="model_id" ref="documents.model_documents_document"/>
306+
<field name="ttype">boolean</field>
307+
</record>
291308
</odoo>

accounting_firm/data/ir_ui_view.xml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<group>
2929
<group id="accounting_firm_id_page_left_group"/>
3030
<group>
31-
<field name="x_id_expiration_date"/>
31+
<field name="x_id_expiration_date" decoration-danger="x_id_expiration_date &lt; current_date"/>
3232
<field name="x_id_scan" widget="pdf_viewer"/>
3333
</group>
3434
</group>
@@ -182,4 +182,19 @@
182182
</xpath>
183183
</field>
184184
</record>
185+
186+
<!-- Documents Request Wizard -->
187+
<record id="document_request_wizard_form_view_inherited" model="ir.ui.view">
188+
<field name="name">documents.request.wizard.form.view.inherited</field>
189+
<field name="model">documents.request_wizard</field>
190+
<field name="type">form</field>
191+
<field name="inherit_id" ref="documents.documents_request_form_view"/>
192+
<field name="active" eval="True"/>
193+
<field name="arch" type="xml">
194+
<xpath expr="//button[@name='request_document']" position="replace">
195+
<button invisible="x_has_chatter_message" name="request_document" type="object" string="Request" class="btn btn-primary" data-hotkey="q"/>
196+
<button invisible="not x_has_chatter_message" name="%(server_action_request_document_with_chatter_message)d" type="action" string="Request" class="btn btn-primary" data-hotkey="q"/>
197+
</xpath>
198+
</field>
199+
</record>
185200
</odoo>

accounting_firm/data/knowledge_article.xml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,13 @@ Otherwise, open the <strong>Sales App</strong> and create a new quote.
117117
<p>When filling in the identity document expiration date, you can leverage the contacts filter "Expired IDs" to efficiently find the IDs to update!</p>
118118
</div>
119119
</div>
120+
<div class="o_editor_banner user-select-none lh-1 d-flex align-items-center alert alert-info pb-0 pt-3 o-contenteditable-false" data-oe-role="status" role="status">
121+
<i class="o_editor_banner_icon mb-3 fst-normal" data-oe-aria-label="Banner Info" aria-label="Banner Info">🔃</i>
122+
<div class="w-100 px-3 o_editor_banner_content o-contenteditable-true" contenteditable="true">
123+
<p>An automation runs daily to request expiring and expired identity documents to your contacts.
124+
Make sure to check the open document request from Documents App.</p>
125+
</div>
126+
</div>
120127
<p>&#xFEFF;<a href="https://www.odoo.com/documentation/latest/applications/essentials/contacts.html" class="btn btn-secondary">&#xFEFF;🎓 Contacts&#xFEFF;</a>&#xFEFF;</p>
121128
<h3>Setup the project</h3>
122129
<p>The project creation created as well some tasks to handle from now on.</p>
@@ -151,7 +158,7 @@ Otherwise, open the <strong>Sales App</strong> and create a new quote.
151158
</div>
152159
</div>
153160
<p>&#xFEFF;<a href="https://www.odoo.com/documentation/latest/applications/services/project.html" class="btn btn-secondary">&#xFEFF;🎓 Project&#xFEFF;</a>&#xFEFF;</p>
154-
<h3>🗂️Document management</h3>
161+
<h3>🗂️ Document management</h3>
155162
<p>Since a tedious part of the job is to request and organise documents for reference and traceability, a good document management system is required!</p>
156163
<div class="o_editor_banner user-select-none o-contenteditable-false lh-1 d-flex align-items-center alert alert-success pb-0 pt-3" data-oe-role="status" role="status">
157164
<i class="o_editor_banner_icon mb-3 fst-normal" data-oe-aria-label="Banner Success" aria-label="Banner Success">✅</i>
@@ -240,7 +247,7 @@ Otherwise, open the <strong>Sales App</strong> and create a new quote.
240247
<p>
241248
<br/>
242249
</p>
243-
<h3>💸 Billing your efforts</h3>
250+
<h3>💵 Billing your efforts</h3>
244251
<p>Whether you performed some work for a fixed price or based on time sheets, you can expense your customer for this.</p>
245252
<ul>
246253
<li>Open the <strong>Sales App</strong> and open the sale order you want to expense.</li>
@@ -300,6 +307,9 @@ Otherwise, open the <strong>Sales App</strong> and create a new quote.
300307
<p>Information captured here are informative only and do not trigger or interact with any capability.</p>
301308
</div>
302309
</div>
310+
<p>
311+
<br/>
312+
</p>
303313
<h3>📊 Follow up on project profitability</h3>
304314
<p>A crucial part of business is as well making sure it is profitable. Odoo helps you following up project profitability with the project Dashboard.</p>
305315
<ul>

accounting_firm/data/project_task.xml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@
2828
<li>Setup tags and recurrences for stand alone tasks (Annual Accounts, Client listing, Ultimate Beneficial Owners register, Corporate Income Tax statement...)</li>
2929
<li>Setup procurement's</li>
3030
</ul>
31-
<p><br /></p>
32-
<hr />
33-
<p><font style="color: rgb(99, 99, 99);">Customer information form (to copy paste in the contact internal notes)</font></p>
3431
]]>
3532
</field>
3633
<field name="project_id" ref="project_project_6" />
@@ -63,9 +60,6 @@
6360
<li>Setup tags and recurrences for stand alone tasks (Annual Accounts, Client listing, Ultimate Beneficial Owners register, Corporate Income Tax statement...)</li>
6461
<li>Setup procurement's</li>
6562
</ul>
66-
<p><br /></p>
67-
<hr />
68-
<p><font style="color: rgb(99, 99, 99);">Customer information form (to copy paste in the contact internal notes)</font></p>
6963
]]>
7064
</field>
7165
<field name="project_id" ref="project_project_3" />
@@ -98,9 +92,6 @@
9892
<li>Setup tags and recurrences for stand alone tasks (Annual Accounts, Client listing, Ultimate Beneficial Owners register, Corporate Income Tax statement...)</li>
9993
<li>Setup procurement's</li>
10094
</ul>
101-
<p><br /></p>
102-
<hr />
103-
<p><font style="color: rgb(99, 99, 99);">Customer information form (to copy paste in the contact internal notes)</font></p>
10495
]]>
10596
</field>
10697
<field name="project_id" ref="project_project_1" />

accounting_firm/demo/res_partner.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@
8585
<field name="vat">BE0462607648</field>
8686
<field name="country_id" ref="base.be"/>
8787
<field name="email">[email protected]</field>
88+
<field name="x_closing_month">march</field>
89+
<field name="x_vat_declaration_recurrence">monthly</field>
90+
<field name="x_interim_situation">monthly</field>
91+
<field name="x_mandate_ids" eval="[(6, 0, [ref('mandate_1'), ref('mandate_2'), ref('mandate_3'), ref('mandate_4'), ref('mandate_5')])]"/>
8892
<field name="x_relation_nature">Accounting Management</field>
8993
<field name="x_aml_assignee_id" ref="base.partner_admin"/>
9094
<field name="x_mission_expiration_date" eval="datetime.today().date() + relativedelta(days=480)"/>
@@ -100,6 +104,10 @@
100104
<field name="vat">BE0477472701</field>
101105
<field name="country_id" ref="base.be"/>
102106
<field name="email">[email protected]</field>
107+
<field name="x_closing_month">july</field>
108+
<field name="x_vat_declaration_recurrence">Quarterly</field>
109+
<field name="x_interim_situation">Quarterly</field>
110+
<field name="x_mandate_ids" eval="[(6, 0, [ref('mandate_2'), ref('mandate_3'), ref('mandate_5'), ref('mandate_6')])]"/>
103111
</record>
104112
<record id="base_industry_data.res_partner_22" model="res.partner" forcecreate="False">
105113
<field name="ubo_national_identifier">BE246813579</field>

accounting_firm/demo/x_mandate.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<odoo noupdate="1">
3+
<record id="mandate_1" model="x_mandate">
4+
<field name="x_name">TVA</field>
5+
</record>
6+
<record id="mandate_2" model="x_mandate">
7+
<field name="x_name">MYMINFIN</field>
8+
</record>
9+
<record id="mandate_3" model="x_mandate">
10+
<field name="x_name">e-DEPO</field>
11+
</record>
12+
<record id="mandate_4" model="x_mandate">
13+
<field name="x_name">FINPROF</field>
14+
</record>
15+
<record id="mandate_5" model="x_mandate">
16+
<field name="x_name">Tax-on-web IPP</field>
17+
</record>
18+
<record id="mandate_6" model="x_mandate">
19+
<field name="x_name">BIZTAX</field>
20+
</record>
21+
</odoo>

0 commit comments

Comments
 (0)