跳至內容
選單
此問題已被標幟
3 回覆
24510 瀏覽次數

Example:

  • Open up an applicant
  • Edit.
  • Open the dropdown for 'contact' and select 'search more'.
  • A tree view of results is displayed with the name/phone number/email of the partner.

I want to add a field (example: street, country, ...) to this result screen. How do I accomplish that?

I tried:

  • Inline tree tag inside the contact field
  • 'tree_view_ref' in the context of the contact field
頭像
捨棄
最佳答案

You have to create your custom tree view in your custom module and then inherit the applicant's view and then add attribute context="{'tree_view_ref': 'your_tree_view_id'}" in context (partner_id) field.

Like this:

<record id="inherit_view_partner_tree" model="ir.ui.view">
    <field name="name">res.partner.inherit.tree</field>
    <field name="model">res.partner</field>
    <field eval="8" name="priority"/>
    <field name="arch" type="xml">
        <tree string="Contacts">
            <field name="name"/>
            <field name="phone"/>
            <field name="email"/>
            <field name="street"/>
            <field name="country_id"/>
        </tree>
    </field>
</record>

<record id="inherit_crm_case_form_view_job" model="ir.ui.view">
    <field name="name">Jobs - Recruitment Form</field>
    <field name="model">hr.applicant</field>
    <field name="inherit_id" ref=" hr_recruitment.crm_case_form_view_job "
        <field name="partner_id" position="attributes">
            <attribute name="context">{'tree_view_ref': 'inherit_view_partner_tree'}</attribute>
        </field>
    <field
</record>
頭像
捨棄

Hi, thanks for your answer ...why should it be in context "partner_id" field, could it be in another field?

I have the following problem, could you take a look and give me some advice?? Thanks in advance!! http://help.openerp.com/question/33086/sale-order-generation-from-product-search/

This worked for me. Thanks for your example. PS: I happened to notice what appears to be a typographical error in your answer, in the first paragraph. There is an extra {"> in context="{">{'tree_view_ref': 'your_tree_view_id'}".

It's worth noting that user-created views won't be addressable in this manner until they are processed by the CSV exporter, because they have no ID string at first, only a numeric ID. See question 22497.

最佳答案

I have the same problem and I got the answer:

eg:

create a custom tree view:

    product.product.tree.ist

    product.product

   

       

           

           

           

           

           

           

           

           

           

       

   


then:

    {'tree_view_ref': 'your_custom_module_name.sale_line_product_search_more_tree_view'}




頭像
捨棄
最佳答案

Hi, Im having a similar problem, could you fix it??

頭像
捨棄

That's a question, not an answer.

相關帖文 回覆 瀏覽次數 活動
0
3月 15
3591
3
2月 25
35318
2
2月 25
8528
1
9月 24
2135
0
4月 16
3026