Hi,

I'm inserting new tabs and fields in company module to make the Brazilian 
electronic invoice.

I created a new module nfe_br that has company.xml too.

*company.xml:*

<tryton>
    <data>
        <record model="ir.ui.view" id="view_company_nfe_form">
            <field name="model">company.company</field>
            <!-- inherits from view company_view_form(ids view) from 
company module -->
            <field name="inherit" ref="company.company_view_form"/>
            <field name="type">form</field>
            <!-- xml file inside of 'view' folder from module that is being 
made -->
            <!-- remember to reference the company.xml on the tryton.cfg -->
            <field name="name">company_form</field>
        </record>
    </data>
</tryton>


I created digital_certificate module to load digital certificates.

Here, in Brazil, one company can have one or more certificates.

I added 2 xml files in view directory: digital_certificate_line_form.xml 
and digital_certificate_line_tree.xml



I added this lines to load digital certificate form and tree views:

*company.xml:*

        <record model="ir.ui.view" id="digital_certificate_line_view_form">
            <field name="model">company.digital_certificate_line</field>
            <field name="type">form</field>
            <field name="name">digital_certificate_line_form</field>
        </record>
        <record model="ir.ui.view" id="digital_certificate_line_view_tree">
            <field name="model">company.digital_certificate_line</field>
            <field name="type">tree</field>
            <field name="priority" eval="10"/>
            <field name="name">digital_certificate_line_tree</field>
        </record>

        <record model="ir.action.act_window" 
id="act_digital_certificate_line_form">
            <field name="name">Digital Certificate Lines</field>
            <field name="res_model">company.digital_certificate_line</field>
        </record>
        <record model="ir.action.act_window.view" 
id="act_digital_certificate_line_form_view1">
            <field name="sequence" eval="10"/>
            <field name="view" ref="digital_certificate_line_view_tree"/>
            <field name="act_window" 
ref="act_digital_certificate_line_form"/>
        </record>
        <record model="ir.action.act_window.view" 
id="act_digital_certificate_line_form_view2">
            <field name="sequence" eval="20"/>
            <field name="view" ref="digital_certificate_line_view_form"/>
            <field name="act_window" 
ref="act_digital_certificate_line_form"/>
        </record>


I updated the code and when I try to enter in 1 company it gives me this 
error:

Error 'name'

  File "/opt/tryton/tryton/gui/window/view_form/view/list.py", line 731, in 
__sig_switch
    if not self.screen.row_activate() and self.children_field:

  File "/opt/tryton/tryton/gui/window/view_form/screen/screen.py", line 
334, in default_row_activate
    self.switch_view(view_type='form')

  File "/opt/tryton/tryton/gui/window/view_form/screen/screen.py", line 
358, in switch_view
    self.load_view_to_load()

  File "/opt/tryton/tryton/gui/window/view_form/screen/screen.py", line 
379, in load_view_to_load
    self.add_view_id(view_id, view_type)

  File "/opt/tryton/tryton/gui/window/view_form/screen/screen.py", line 
392, in add_view_id
    return self.add_view(view)

  File "/opt/tryton/tryton/gui/window/view_form/screen/screen.py", line 
425, in add_view
    children_field=children_field)

  File "/opt/tryton/tryton/gui/window/view_form/view/widget_parse.py", line 
40, in parse
    fields)

  File "/opt/tryton/tryton/gui/window/view_form/view/form_gtk/parser.py", 
line 316, in parse
    notebook, tooltips=tooltips)

  File "/opt/tryton/tryton/gui/window/view_form/view/form_gtk/parser.py", 
line 373, in parse
    notebook, tooltips=tooltips)

  File "/opt/tryton/tryton/gui/window/view_form/view/form_gtk/parser.py", 
line 418, in parse
    widget_act = WIDGETS_TYPE[ftype][0](name, model_name, attrs)

  File "/opt/tryton/tryton/gui/window/view_form/view/form_gtk/one2many.py", 
line 181, in __init__
    exclude_field=attrs.get('relation_field', None))

  File "/opt/tryton/tryton/gui/window/view_form/screen/screen.py", line 97, 
in __init__
    self.switch_view()

  File "/opt/tryton/tryton/gui/window/view_form/screen/screen.py", line 
369, in switch_view
    self.display()

  File "/opt/tryton/tryton/gui/window/view_form/screen/screen.py", line 
692, in display
    in ('tree', 'graph', 'calendar'))

  File "/opt/tryton/tryton/gui/window/view_form/screen/screen.py", line 
132, in search_active
    fields = odict((name, fields[name]) for name in xml_fields)

  File "/usr/lib/python2.7/collections.py", line 51, in __init__
    self.__update(*args, **kwds)

  File "/usr/lib/python2.7/_abcoll.py", line 499, in update
    for key, value in other:

  File "/opt/tryton/tryton/gui/window/view_form/screen/screen.py", line 
132, in <genexpr>
    fields = odict((name, fields[name]) for name in xml_fields)

I've looked at the ir.ui.view table and the view's names are correct. The 
model name too:

"380";"company.digital_certificate_line";"form";"";"";16;"2013-08-29 
18:32:51.261802";"";0;;"";"digital_certificate_line_form";;"nfe_br"
"381";"company.digital_certificate_line";"tree";"";"";10;"2013-08-29 
18:32:51.273984";"";0;;"";"digital_certificate_line_tree";;"nfe_br"


What am I doing wrong?

Reply via email to