Error occuring as "No LSB modules are available"

Asked by Deven Moga on 2009-08-27

Hello,

I am trying to change the display name of the different fields in the Purchase order screen. Below is my code.

<record id="purchase_order_form_inherit_for_deliveryandinvoice" model="ir.ui.view">
     <field name="name">purchase.order.form.inherit_for_deliveryandinvoice</field>
            <field name="model">purchase.order</field>
            <field name="type">form</field>
     <field name="inherit_id" ref="purchase.purchase.order.form"/>
            <!--<field name="arch" type="xml">
                  <field name="invoice_method" string="Hi"/>
      </field>-->
</record>

Currently i have commented the code where i want to put custom display name. But either it is commented or uncommented, it's generating below error,

No LSB modules are available.
[2009-08-27 11:45:50,375] ERROR:init:[01]:
[2009-08-27 11:45:50,376] ERROR:init:[02]: Environment Information :
[2009-08-27 11:45:50,376] ERROR:init:[03]: System : Linux-2.6.27-14-generic-i686-with-debian-lenny-sid
[2009-08-27 11:45:50,376] ERROR:init:[04]: OS Name : posix
[2009-08-27 11:45:50,376] ERROR:init:[05]: Distributor ID: Ubuntu
[2009-08-27 11:45:50,376] ERROR:init:[06]: Description: Ubuntu 8.10
[2009-08-27 11:45:50,376] ERROR:init:[07]: Release: 8.10
[2009-08-27 11:45:50,376] ERROR:init:[08]: Codename: intrepid
[2009-08-27 11:45:50,376] ERROR:init:[09]: Operating System Release : 2.6.27-14-generic
[2009-08-27 11:45:50,377] ERROR:init:[10]: Operating System Version : #1 SMP Tue Aug 18 16:25:45 UTC 2009
[2009-08-27 11:45:50,377] ERROR:init:[11]: Operating System Architecture : 32bit
[2009-08-27 11:45:50,377] ERROR:init:[12]: Operating System Locale : en_IN.ISO8859-1
[2009-08-27 11:45:50,377] ERROR:init:[13]: Python Version : 2.5.2
[2009-08-27 11:45:50,377] ERROR:init:[14]: OpenERP-Server Version : 5.0.3
[2009-08-27 11:45:50,377] ERROR:init:[15]: Last revision No. & ID : 1839 <email address hidden>
[2009-08-27 11:45:50,377] ERROR:init:[16]: <record id="purchase_order_form_inherit_for_deliveryandinvoice" model="ir.ui.view">
[2009-08-27 11:45:50,377] ERROR:init:[17]: <field name="name">purchase.order.form.inherit_for_deliveryandinvoice</field>
[2009-08-27 11:45:50,377] ERROR:init:[18]: <field name="model">purchase.order</field>
[2009-08-27 11:45:50,377] ERROR:init:[19]: <field name="type">form</field>
[2009-08-27 11:45:50,378] ERROR:init:[20]: <field name="inherit_id" ref="purchase.purchase.order.form"/>
[2009-08-27 11:45:50,378] ERROR:init:[21]: <!--<field name="arch" type="xml">
[2009-08-27 11:45:50,378] ERROR:init:[22]: <field name="invoice_method" string="Hi"/>
[2009-08-27 11:45:50,378] ERROR:init:[23]: </field>-->
[2009-08-27 11:45:50,378] ERROR:init:[24]: </record>

Please kindly provide solution for this error.
Waiting for the valuable reply.

Sincerely,
Deven

Question information

Language:
English Edit question
Status:
Solved
For:
Odoo Addons (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Solved by:
Jay Vora (Serpent Consulting Services)
Solved:
2009-08-27
Last query:
2009-08-27
Last reply:
2009-08-27

Hello Deven,

Would you please tell me whether the ref you use for inherit_id field is the correct one?

I doubt because it should be MODULENAME.XMLID. not the MODULENAME.FORMNAME

IMHO, it should be purchase.purchase_order_form.

Thanks.

Deven Moga (erpsupport) said : #2

Hello Jay,

I am not getting your answer completely. Can you provide me some example for that?

And another thing if i am trying to hide any PAGE or any STRING or any GROUP, i am getting same error. Can you please also tell me how can i hide above things?
It will be very appericiable if you provide me some example.

Deven

Hi Deven,

The problem resides in your code.
It should be <field name="inherit_id" ref="purchase.purchase_order_form"/>
purchase_order_form is the id of the xml record on purchase module. purchase.order.form is the name of the record.

Example is in addons/account/partner_view.xml file where we have inherited partner's form view, and added a new tab.

You can hide page,group ,etc. but this error causes the break in the flow.

Notify me if the problem still persists.

Thanks.

Deven Moga (erpsupport) said : #4

Hi Jay,

When i used your solution it gives me following error.

ERROR : Couldn't find tag '<field name="invoice_method" string="Hi">' in parent view !

Environment Information :
System : Linux-2.6.27-14-generic-i686-with-debian-lenny-sid
OS Name : posix
Distributor ID: Ubuntu
Description: Ubuntu 8.10
Release: 8.10
Codename: intrepid
Operating System Release : 2.6.27-14-generic
Operating System Version : #1 SMP Tue Aug 18 16:25:45 UTC 2009
Operating System Architecture : 32bit
Operating System Locale : en_IN.ISO8859-1
Python Version : 2.5.2
OpenERP-Client Version : 5.0.3
Last revision No. & ID : 984 <email address hidden>
Traceback (most recent call last):
  File "/home/deven/workspace/server/bin/netsvc.py", line 242, in dispatch
    result = LocalService(service_name)(method, *params)
  File "/home/deven/workspace/server/bin/netsvc.py", line 73, in __call__
    return getattr(self, method)(*params)
  File "/home/deven/workspace/server/bin/service/web_services.py", line 583, in execute
    res = service.execute(db, uid, object, method, *args)
  File "/home/deven/workspace/server/bin/osv/osv.py", line 59, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/deven/workspace/server/bin/osv/osv.py", line 119, in execute
    res = pool.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/deven/workspace/server/bin/osv/osv.py", line 111, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/deven/workspace/server/bin/osv/orm.py", line 1217, in fields_view_get
    result['arch'] = _inherit_apply_rec(result['arch'], sql_res[3])
  File "/home/deven/workspace/server/bin/osv/orm.py", line 1213, in _inherit_apply_rec
    result = _inherit_apply(result, inherit)
  File "/home/deven/workspace/server/bin/osv/orm.py", line 1173, in _inherit_apply
    raise AttributeError(_("Couldn't find tag '%s' in parent view !") % tag)
AttributeError: Couldn't find tag '<field name="invoice_method" string="Hi">' in parent view !

Please provide some solution.

Deven

Hi Deven,

If you look at the existing codes, it is quite a basic issue.

The Interpretation of this error is, the parent view(purchase_order_form) does not have any field with the same signature.

You code must be:
            <field name="arch" type="xml">
                <field name="invoice_method" position="replace">
                    <field name="invoice_method" string="HI"/>
                </field>
            </field>

Thanks.

Deven Moga (erpsupport) said : #6

Hello Jay,

It worked. But there is one problem that if i want to change the name of PAGE string then how can i do that? For example in purchase order string i want to change "Delivery &amp; Invoices" to "Delivery". Can you please tell me how can i do that?

Deven

Hi Deven,

This stuff follows the same idealogy.

<field name="arch" type="xml">
                <page string="XYZ" position="replace">
                    <page string="HI">
                     Copy the whole page children tags
                  </page>
            </page>
</field>

Here, You want to replace anything to any tag, you can do like this simply. You need all the children tags too if any.

Thanks.

Deven Moga (erpsupport) said : #8

Hi Jay,

I done above procedure, but instead of replacing the page, it duplicates the Page and generate the another page which i want to create.

So i decided to replace the whole notebook but when i do that it gives me above error.
what should i do now?

Deven

Deven Moga (erpsupport) said : #9

Thanks Jay (Open ERP), that solved my question.