This question has been flagged

This is my tree view:


<record model="ir.ui.view" id="apparel_matrix.button">
<field name="name">sale.order.form</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<field name="note" position="before">
<div>
<button name="apparel_matrix_button" string="Apparel Matrix" type="object"
class="oe_inline arrow-right oe_highlight"/>
</div>
<div> <p></p></div>
</field>
</field>
</record>

<record model="ir.actions.act_window" id="apparel_matrix_tree_view">
<field name="name">apparel_matrix.tree</field>
<field name="res_model">apparel_matrix.apparel_matrix</field>
<!--<field name="view_type">tree</field>-->
<field name="view_mode">tree</field>
<field name="arch" type="xml">
<tree>
<field name="main_product" />
<field name="color" />
<field name="size_s" />
<field name="size_m" />
<field name="size_l" />
<field name="size_xl" />
<field name="size_xxl" />
<field name="size_xxxl" />
</tree>
</field>
</record>


and this is function that's being called on click of a button:


class apparel_matrix_button(models.Model):
_inherit = 'sale.order'
@api.multi
def apparel_matrix_button(self):
apparel_matrix_tree_id = self.env.ref('apparel_matrix.apparel_matrix_tree_view').id
return {
'type': 'ir.actions.act_window',
'views':[[apparel_matrix_tree_id,'tree']],
'res_model': 'apparel_matrix.apparel_matrix',
# 'res_id': apparel_matrix.id,
# 'context': apparel_matrix.env.context,
'target': 'new',
'flags': {'initial_mode': 'edit'},
'key2': 'client_action_multi'
}



Traceback (most recent call last):
  File "/home/gaurav/workspace/odoo/odoo/http.py", line 638, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/home/gaurav/workspace/odoo/odoo/http.py", line 675, in dispatch
    result = self._call_function(**self.params)
  File "/home/gaurav/workspace/odoo/odoo/http.py", line 331, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/home/gaurav/workspace/odoo/odoo/service/model.py", line 119, in wrapper
    return f(dbname, *args, **kwargs)
  File "/home/gaurav/workspace/odoo/odoo/http.py", line 324, in checked_call
    result = self.endpoint(*a, **kw)
  File "/home/gaurav/workspace/odoo/odoo/http.py", line 933, in __call__
    return self.method(*args, **kw)
  File "/home/gaurav/workspace/odoo/odoo/http.py", line 504, in response_wrap
    response = f(*args, **kw)
  File "/home/gaurav/workspace/odoo/addons/web/controllers/main.py", line 862, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/home/gaurav/workspace/odoo/addons/web/controllers/main.py", line 854, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/home/gaurav/workspace/odoo/odoo/api.py", line 679, in call_kw
    return call_kw_model(method, model, args, kwargs)
  File "/home/gaurav/workspace/odoo/odoo/api.py", line 664, in call_kw_model
    result = method(recs, *args, **kwargs)
  File "/home/gaurav/workspace/odoo/odoo/models.py", line 1329, in load_views
    for [v_id, v_type] in views
  File "/home/gaurav/workspace/odoo/odoo/models.py", line 1329, in <dictcomp>
    for [v_id, v_type] in views
  File "/home/gaurav/workspace/odoo/odoo/models.py", line 1408, in fields_view_get
    xarch, xfields = View.postprocess_and_fields(self._name, etree.fromstring(result['arch']), view_id)
  File "/home/gaurav/workspace/odoo/odoo/addons/base/ir/ir_ui_view.py", line 896, in postprocess_and_fields
    self.raise_view_error(message, view_id)
  File "/home/gaurav/workspace/odoo/odoo/addons/base/ir/ir_ui_view.py", line 454, in raise_view_error
    raise ValueError(message)
ValueError: Field `check_manual_sequencing` does not exist

Error context:
View `view.account.payment.form.inherit.payment`
[view_id: 524, xml_id: payment.view_account_payment_form_inherit_payment, model: account.payment, parent_id: 341]


The issue is odoo seems to be assigning the database id for the view to an already existing one and looking for unnecessary fields in that one. I made sure of this on odoo shell:


>>> self.env.ref('apparel_matrix.apparel_matrix_tree_view').id 
524
>>> self.env.ref('payment.view_account_payment_form_inherit_payment').id
524


I've tried changing the external_id of view and re-running the server with it but every time it will increment the view_id but that'll be also assigned to some already existing view. What am i doing wrong here? I was trying to follow this answer here : https://stackoverflow.com/questions/38060628/odoo-8-open-treeview-from-wizard


Avatar
Discard
Author

Okay, I found solution to this i was defining my action view incorrectly. needed to make separate record for tree and view_id in action's record set to it. :P