NM Naufaldo
NM Naufaldo

Reputation: 1160

Odoo Custom Tree Control

If you create new quotation in the Sales module, there are some control buttons:

enter image description here

I want to create those custom control for my tree view. But when I search from the source code, I can't find where is the python method is called.

...
<tree string="Sales Order Lines" editable="bottom">
    <control>
        <create name="add_product_control" string="Add a product"/>
        <create name="add_section_control" string="Add a section" context="{'default_display_type': 'line_section'}"/>
        <create name="add_note_control" string="Add a note" context="{'default_display_type': 'line_note'}"/>
    </control>
...

I search the add_product_control keyword, but there is nothing I found.

Upvotes: 1

Views: 549

Answers (1)

Ravi Ponkia
Ravi Ponkia

Reputation: 11

Because odoo is not calling any python method it will trigger from javascript side and it will add new record and hide other fields using display_type display-types

  1. line_section
  2. line_note

and you can find code in /addons/account/static/src/js/section_and_note_fields_backend.js

Upvotes: 1

Related Questions