2017-05-16 5 views
0

Ich erstelle ein benutzerdefiniertes Modul, um eine neue Zeile in die Strukturansicht einzufügen.Wie bekomme ich das Elternmodell vom Kindmodell in Odoo 9?

Ich versuche, eine neue Zeile mit Muttermodell „project.project“ in Baumansicht „project.task“

hinzufügen und was ich habe, ist bisher getan

<?xml version="1.0" encoding="UTF-8"?> 
<templates id="template" xml:space="preserve"> 
    <t t-extend="ListView"> 
     <t t-jquery="thead" t-operation="before"> 
      <t t-if="options.action.res_model=='project.task'"> 
       <button type="button" class="btn btn-sm btn-primary o_list_button_add" accesskey="C"> 
        <!-- I'd like to add project.project's custom field below --> 
        <t t-esc="project.project.custom.field"/> 
       </button> 
      </t> 
     </t> 
    </t> 
</templates> 

I Möchte dem Button-Namen ein benutzerdefiniertes Feld hinzufügen.

Bitte helfen

Antwort

0

Haben Sie es so versucht?

<!-- I'd like to add project.project's custom field below --> 
<t t-esc="o.project.project.custom.field"/> 
+0

Ja, ich tat, aber es funktioniert nicht. Es wird ein Fehler gemacht "Projekt ist nicht definiert" – Jinna