I want to generate lead from e-mail , So, using beautifulsoup library
Parsed e-mail data.
and also customize lead form view.
XML file is also include.
As shown below two list, I have to create single lead and append this data.
[['1. Integrated Defence Staff', 'Port Blair / Andaman And Nicobar'], ['Procurement For Defect Rectification Of Wincc Pc-1 (Master Pc) Of Ballast Control System Of Fdn-1.'], ['TID : 30471812 | Like', 'Refer Document']
[['Due on 14-7-2018']]
Append like this format:
Product detail field: Integrated Defence Staf
Tender Link/URL : Procurement For Defect Rectification Of Wincc Pc-1 (Master Pc) Of Ballast Control System Of Fdn-1 --> append as a Link
Tender ID/ Ref No: 3047181
Tender Due on: 14-7-2018
______________________ XML File __________________________
<odoo>
<data>
<record model="ir.ui.view" id="crm_case_form_view_leads">
<field name="name">CRM-Leads Form</field>
<field name="model">crm.lead</field>
<field name="inherit_id" ref="crm.crm_case_form_view_leads"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='partner_id']" position="before">
<field name="id" string='Lead ID'/>
<field name="create_date" string='Lead Entry Date'/>
<field name="tender_start_date"/>
<field name="ref_no" string='Tender ID / Ref No.'/>
<field name="tender_url"/>
</xpath>
<xpath expr="//field[@name='partner_id']" position="replace">
</xpath>
<xpath expr="//field[@name='partner_name']" position="replace">
</xpath>
<xpath expr="//field[@name='street']" position="replace">
</xpath>
<xpath expr="//field[@name='street2']" position="replace">
</xpath>
<xpath expr="//field[@name='city']" position="replace">
</xpath>
<xpath expr="//field[@name='state_id']" position="replace">
</xpath>
<xpath expr="//field[@name='zip']" position="replace">
</xpath>
<xpath expr="//field[@name='country_id']" position="replace">
</xpath>
<label for="street" position="replace">
</label>
<xpath expr="//field[@name='function']" position="replace">
</xpath>
<xpath expr="//field[@name='email_from']" position="before">
<field name="partner_id"/>
<field name="partner_name"/>
<field name="website"/>
<field name="function"/>
</xpath>
<xpath expr="//field[@name='mobile']" position="after">
<label for="street" string="Address"/>
<div class="o_address_format">
<field name="street" placeholder="Street..." class="o_address_street"/>
<field name="street2" placeholder="Street 2..." class="o_address_street"/>
<field name="city" placeholder="City" class="o_address_city"/>
<field name="state_id" class="o_address_state" placeholder="State" options='{"no_open": True}'/>
<field name="zip" placeholder="ZIP" class="o_address_zip"/>
<field name="country_id" placeholder="Country" class="o_address_country" options='{"no_open": True, "no_create": True}'/>
</div>
</xpath>
<xpath expr="//field[@name='website']" position="after">
<field name="tech_ids" widget="many2many_tags"/>
<field name="product_details"/>
<field name="doc_fee"/>
<field name="emd"/>
<field name="project_value"/>
<field name="other_doc" widget="many2many_binary"/>
<field name="tender_close_date"/>
</xpath>
<xpath expr="//field[@name='website']" position="replace">
</xpath>
<xpath expr="//field[@name='team_id']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='priority']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='title']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='partner_name']" position="attributes">
<attribute name="string">Company/Organization</attribute>
</xpath>
<xpath expr="//field[@name='function']" position="attributes">
<attribute name="string">Designation</attribute>
</xpath>
<xpath expr="//field[@name='user_id']" position="attributes">
<attribute name="string">Assignee</attribute>
</xpath>
<xpath expr="//field[@name='name']" position="attributes">
<attribute name="string">Tender title</attribute>
</xpath>
</field>
</record>
</data>
</odoo>