콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
6255 화면

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?

아바타
취소
베스트 답변

<?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. 

아바타
취소
작성자

Is this working for you?

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

작성자

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.

작성자

<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.

작성자

Thank you

관련 게시물 답글 화면 활동
1
11월 21
3947
3
9월 21
5229
5
9월 21
20842
0
11월 21
2556
8
3월 20
4991