Accidentally deleted a valuation field from xml. Unable to figure out how to fix it?
I have done inventory valuation for stockable product. And accidentally I have deleted its reference form products view. I am not able to remove the warehouse app and install if again it gives the below error. Its been over a week to figure out how to fix it and I don't want to drop the table. Looks like the answer is in the error its self but unable to figure it out.
Odoo Server Error
Traceback (most recent call last):
File "/opt/odoo/odoo/openerp/http.py", line 546, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/opt/odoo/odoo/openerp/http.py", line 583, in dispatch
result = self._call_function(**self.params)
File "/opt/odoo/odoo/openerp/http.py", line 319, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/opt/odoo/odoo/openerp/service/model.py", line 118, in wrapper
return f(dbname, *args, **kwargs)
File "/opt/odoo/odoo/openerp/http.py", line 316, in checked_call
return self.endpoint(*a, **kw)
File "/opt/odoo/odoo/openerp/http.py", line 812, in __call__
return self.method(*args, **kw)
File "/opt/odoo/odoo/openerp/http.py", line 412, in response_wrap
response = f(*args, **kw)
File "/opt/odoo/odoo/addons/web/controllers/main.py", line 948, in call_button
action = self._call_kw(model, method, args, {})
File "/opt/odoo/odoo/addons/web/controllers/main.py", line 936, in _call_kw
return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
File "/opt/odoo/odoo/openerp/api.py", line 268, in wrapper
return old_api(self, *args, **kwargs)
File "/opt/odoo/odoo/openerp/addons/base/module/module.py", line 447, in button_immediate_install
return self._button_immediate_function(cr, uid, ids, self.button_install, context=context)
File "/opt/odoo/odoo/openerp/api.py", line 268, in wrapper
return old_api(self, *args, **kwargs)
File "/opt/odoo/odoo/openerp/addons/base/module/module.py", line 495, in _button_immediate_function
registry = openerp.modules.registry.RegistryManager.new(cr.dbname, update_module=True)
File "/opt/odoo/odoo/openerp/modules/registry.py", line 370, in new
openerp.modules.load_modules(registry._db, force_demo, status, update_module)
File "/opt/odoo/odoo/openerp/modules/loading.py", line 355, in load_modules
loaded_modules, update_module)
File "/opt/odoo/odoo/openerp/modules/loading.py", line 255, in load_marked_modules
loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
File "/opt/odoo/odoo/openerp/modules/loading.py", line 176, in load_module_graph
_load_data(cr, module_name, idref, mode, kind='data')
File "/opt/odoo/odoo/openerp/modules/loading.py", line 118, in _load_data
tools.convert_file(cr, module_name, filename, idref, mode, noupdate, kind, report)
File "/opt/odoo/odoo/openerp/tools/convert.py", line 897, in convert_file
convert_xml_import(cr, module, fp, idref, mode, noupdate, report)
File "/opt/odoo/odoo/openerp/tools/convert.py", line 983, in convert_xml_import
obj.parse(doc.getroot(), mode=mode)
File "/opt/odoo/odoo/openerp/tools/convert.py", line 849, in parse
self._tags[rec.tag](self.cr, rec, n, mode=mode)
File "/opt/odoo/odoo/openerp/tools/convert.py", line 759, in _tag_record
id = self.pool['ir.model.data']._update(cr, self.uid, rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode, context=rec_context )
File "/opt/odoo/odoo/openerp/api.py", line 268, in wrapper
return old_api(self, *args, **kwargs)
File "/opt/odoo/odoo/openerp/addons/base/ir/ir_model.py", line 1069, in _update
res_id = model_obj.create(cr, uid, values, context=context)
File "/opt/odoo/odoo/openerp/api.py", line 268, in wrapper
return old_api(self, *args, **kwargs)
File "/opt/odoo/odoo/openerp/addons/base/ir/ir_ui_view.py", line 263, in create
context=context)
File "/opt/odoo/odoo/openerp/api.py", line 268, in wrapper
return old_api(self, *args, **kwargs)
File "/opt/odoo/odoo/openerp/api.py", line 372, in old_api
result = method(recs, *args, **kwargs)
File "/opt/odoo/odoo/openerp/models.py", line 4101, in create
record = self.browse(self._create(old_vals))
File "/opt/odoo/odoo/openerp/api.py", line 266, in wrapper
return new_api(self, *args, **kwargs)
File "/opt/odoo/odoo/openerp/api.py", line 508, in new_api
result = method(self._model, cr, uid, *args, **old_kwargs)
File "/opt/odoo/odoo/openerp/models.py", line 4298, in _create
recs._validate_fields(vals)
File "/opt/odoo/odoo/openerp/api.py", line 266, in wrapper
return new_api(self, *args, **kwargs)
File "/opt/odoo/odoo/openerp/models.py", line 1275, in _validate_fields
raise ValidationError('\n'.join(errors))
ParseError: "ValidateError
Field(s) `arch` failed against a constraint: Invalid view definition
Error details:
Field `valuation` does not exist
Error context:
View `product.template.stock.property.form.inherit`
[view_id: 1030, xml_id: n/a, model: product.template, parent_id: 254]" while parsing /opt/odoo/odoo/addons/stock/product_view.xml:98, near
<record id="view_template_property_form" model="ir.ui.view">
<field name="name">product.template.stock.property.form.inherit</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<data><group name="sale_condition" position="inside">
<label for="sale_delay"/>
<div>
<field name="sale_delay" attrs="{'readonly':[('sale_ok','=',False)]}" class="oe_inline" style="vertical-align:baseline"/> days
</div>
</group>
<group name="status" position="before">
<group string="Stock and Expected Variations" attrs="{'invisible': [('type', '=', 'service')]}" groups="base.group_user">
<label for="qty_available"/>
<div>
<field name="qty_available" class="oe_inline"/>
<button name="%(action_view_change_product_quantity)d" string="⇒ Update" type="action" class="oe_link"/>
</div>
<label for="incoming_qty"/>
<div>
<field name="incoming_qty" class="oe_inline"/>
<button string="⇒ Request Procurement" name="%(stock.act_make_procurement)d" type="action" class="oe_link"/>
</div>
<field name="virtual_available"/>
</group>
</group>
<group name="status" position="after">
<group name="store" string="Storage Location" attrs="{'invisible':[('type','=','service')]}">
<field name="loc_rack"/>
<field name="loc_row"/>
<field name="loc_case"/>
</group>
</group>
<group name="status" position="before">
<group name="lot" groups="stock.group_production_lot" string="Lots" attrs="{'invisible':[('type','=','service')]}">
<field name="track_all" groups="stock.group_production_lot"/>
<field name="track_incoming" groups="stock.group_production_lot" attrs="{'invisible': [('track_all', '=', True)]}"/>
<field name="track_outgoing" groups="stock.group_production_lot" attrs="{'invisible': [('track_all', '=', True)]}"/>
</group>
</group>
<group name="weight" position="before">
<group name="store" groups="stock.group_locations" string="Counter-Part Locations Properties" attrs="{'invisible':[('type','=','service')]}">
<field name="property_stock_procurement" domain="[('usage','=','procurement')]"/>
<field name="property_stock_production" domain="[('usage','=','production')]"/>
<field name="property_stock_inventory" domain="[('usage','=','inventory')]"/>
</group>
</group>
<field name="product_manager" position="attributes">
<attribute name="context" translation="off">{'default_groups_ref': ['base.group_user', 'base.group_sale_manager', 'stock.group_stock_manager']}</attribute>
</field>
<group name="procurement_uom" position="after">
<group string="Supply Chain Information" attrs="{'invisible': [('type', '=', 'service')]}" groups="base.group_user">
<field name="route_ids" widget="many2many_checkboxes"/>
</group>
</group>
</data></field>
</record>