Skip to content

Commit

Permalink
feat: very last data synced for producers in CRM (#10)
Browse files Browse the repository at this point in the history
Some changes that I forgot to push last time

    Fields
        x_off_last_template_download_date
        x_off_last_logged_org_contact
        x_off_last_import_type

    Category (res.partner.category): Producer, AGENA3000, EQUADIS, CSV, Manual import, BAYARD, SFTP
  • Loading branch information
4nt0ineB authored Jul 22, 2024
1 parent aab7e15 commit d8ddf65
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 8 deletions.
9 changes: 7 additions & 2 deletions producers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
- x_off_main_contact
- x_off_last_import_date
- x_off_last_export_date
- x_off_last_logged_org_contact
- x_off_last_template_download_date
- x_off_last_import_type
- x_off_user_login_date

- Inherited view:

Expand All @@ -25,8 +29,9 @@

- Open in pro plateform as org (res.partner)

- Tags (crm.tag):
- onboarding
- Tags (crm.tag): onboarding

- Category (res.partner.category): Producer, AGENA3000, EQUADIS, CSV, Manual import, BAYARD, SFTP

[Dasel](https://github.com/TomWright/dasel) was used to transform Odoo csv exports into yaml :

Expand Down
73 changes: 73 additions & 0 deletions producers/ir_model_fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,76 @@
Field Help: OFF org id
Related Field:
Selectable: True
- Field Name: x_off_last_logged_org_contact
Field Label: Last logged contact
Model: Contact
Field Type: many2one
Type: Custom Field
Indexed:
Stored: True
Readonly:
Related Model: res.partner
Blacklisted in web forms: True
Size: "0"
Required:
On Delete: Set NULL
ID: "9444"
Domain: "[]"
Field Help: The contact who logged on the pro platform last
Related Field:
Selectable: True
- Field Name: x_off_user_login_date
Field Label: Last logged contact date
Model: Contact
Field Type: date
Type: Custom Field
Indexed:
Stored: True
Readonly:
Related Model:
Blacklisted in web forms: True
Size: "0"
Required:
On Delete:
ID: "9441"
Domain: "[]"
Field Help: Date when last contact logged on to the pro platform
Related Field:
Selectable: True
- Field Name: x_off_last_template_download_date
Field Label: Last template download
Model: Contact
Field Type: date
Type: Custom Field
Indexed:
Stored: True
Readonly:
Related Model:
Blacklisted in web forms: True
Size: "0"
Required:
On Delete:
ID: "9449"
Domain: "[]"
Field Help: The last time the template was downloaded by a contact of the company in the pro platform
Related Field:
Selectable: True
- Field Name: x_off_last_import_type
Field Label: Last import type
Model: Contact
Field Type: many2one
Type: Custom Field
Indexed:
Stored: True
Readonly:
Related Model: res.partner.category
Blacklisted in web forms: True
Size: "0"
Required:
On Delete: Set NULL
ID: "9457"
Domain: '[]'
Field Help: Typology of last import
Related Field:
Selectable: True

14 changes: 9 additions & 5 deletions producers/ir_ui_view.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@
<div class="oe_clear"/>
<button name="531<--replace by the action server id" type="action" string="Open in pro platform" class="oe_highlight" attrs="{'invisible': [('x_off_org_id', '=', False)]}"/>
</xpath>
<xpath expr="//field[@name='x_off_username']" position="after" attrs="{'invisible': [('is_company','=', False)]}">
<field name="x_off_org_id" placeholder="Open Food Facts org id"/>
<field name="x_off_main_contact" widget="res_partner_many2one" options="{'no_open': True, 'no_create': True}" domain="[('parent_id', '=', active_id)]" attrs="{'invisible': [('is_company','=', False)]}"/>
<field name="x_off_last_import_date" readonly="1" attrs="{'invisible': [('is_company','=', False)]}"/>
<field name="x_off_last_export_date" readonly="1" attrs="{'invisible': [('is_company','=', False)]}"/>
<xpath expr="//field[@name='vat']" position="after">
<field name="x_off_org_id" placeholder="Open Food Facts org id" attrs="{'invisible': [('is_company','=', False)]}"/>
<field name="x_off_main_contact" widget="res_partner_many2one" options="{'no_create': True}" domain="[('parent_id', '=', active_id)]" attrs="{'invisible': [('x_off_org_id', '=', False)]}"/>
<field name="x_off_last_logged_org_contact" readonly="1" attrs="{'invisible': [('x_off_org_id', '=', False)]}"/>
<field name="x_off_last_import_date" readonly="1" attrs="{'invisible': [('x_off_org_id', '=', False)]}"/>
<field name="x_off_last_import_type" widget="many2one" options="{'invisible': [('x_off_org_id', '=', False)], 'no_create': True, 'no_open': True, 'no_quick_create': True}"/>
<field name="x_off_last_export_date" readonly="1" attrs="{'invisible': [('x_off_org_id', '=', False)]}"/>
<field name="x_off_last_template_download_date" readonly="1" attrs="{'invisible': [('x_off_org_id', '=', False)]}"/>
<field name="x_off_user_login_date" readonly="1" attrs="{'invisible': [('x_off_username', '=', False)]}"/>
</xpath>
Active: True
View inheritance mode: Extension View
2 changes: 1 addition & 1 deletion producers/mail_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
To (Partners): "{{ object.x_off_main_contact.id }}"
Report Filename:
Body: "<p style=\"box-sizing:border-box;margin-bottom: 0px;\">Welcome \nto Open Food Facts' producer's platform.<br></p><p style=\"box-sizing:border-box;margin-bottom: 0px;\">\nYou are the main contact for <t t-out=\"object.name or ''\" data-oe-t-inline=\"true\"></t></p>"
Language: "{{ object.lang }}"
Language: "{{ object.x_off_main_contact.lang }}"

0 comments on commit d8ddf65

Please sign in to comment.