This question has been flagged
1 Reply
4808 Views

In addons, website_sale module -> data folder -> data.xml you could see how the create a customer form parameter's action appears in a coding format. Also you could see website_sale module -> static folder-> src folder-> website_sale_form.xml file in which the form we can view is given in code. I just need to inherit them and create an alumni form. Could anyone please tell me the solution for it? Also suggest whether it is a good way of doing it?

Avatar
Discard
Best Answer

<?xml version="1.0" encoding="utf-8"?>

<odoo>

<record id="any name="ir.ui.view">

<field name="name">name</field>

<field name="model">model name</field>

<field name="inherit_id" ref="module(from which you want to inherit in your case website_sale).(form id)"/>

</field>

</record>

</odoo>

In this way you can inherit existing form view . When you want to add any field in existing view you can add there by using this method.

Thanks. 

Avatar
Discard
Author

Is this working for you?

Yes Perfectly. Did this many times. Isn't this working for you?

Author

Hi Jay Dasni,

I am sorry, you should look here

https://www.odoo.com/forum/help-1/question/how-to-inherit-create-a-customer-form-of-form-builder-in-odoo13-to-the-custom-form-using-form-builder-165803

The question is inter connected. You answered me for the view to be inherited that's right. But I needed the answer for creating the website form. Also you must look at these lines of codes from website_sale module -> data folder-> data.xml

<data>

<record id="sale.model_sale_order" model="ir.model">

<field name="website_form_access" eval="True"/>

<field name="website_form_label">Sales Order</field>

</record>

<function model="ir.model.fields" name="formbuilder_whitelist">

<value>sale.order</value>

<value eval="[

'client_order_ref',

]"/>

</function>

<record id="base.model_res_partner" model="ir.model">

<field name="website_form_key">create_customer</field>

<field name="website_form_access">True</field>

<field name="website_form_label">Create a Customer</field>

</record>

<function model="ir.model.fields" name="formbuilder_whitelist">

<value>res.partner</value>

<value eval="[

'name', 'phone', 'email',

'city', 'zip', 'street', 'street2', 'state_id', 'country_id',

'vat', 'company_name'

]"/>

</function>

</data>

You should look carefully in the code, before answering. Please have a look at these codes. I am not able to give any record id here. Have a look.

Author

<data>

<record id="hr_recruitment.model_hr_applicant" model="ir.model">

<field name="website_form_key">apply_job</field>

<field name="website_form_default_field_id" ref="hr_recruitment.field_hr_applicant__description" />

<field name="website_form_access">True</field>

<field name="website_form_label">Apply for a Job</field>

</record>

<function model="ir.model.fields" name="formbuilder_whitelist">

<value>hr.applicant</value>

<value eval="[

'description',

'email_from',

'partner_name',

'partner_phone',

'job_id',

'department_id',

]"/>

</function>

</data>

This is the code from website_hr_recruitment module -> data folder ->config_data.xml

<field name="website_form_default_field_id" ref="hr_recruitment.field_hr_applicant__description" />

You can see the line here right? How the ref was given? How it was choosen and from where?

Ok. I will check this and if i will find solution I will let you know.

Author

Thank you