← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 719468] Re: [trunk6-dev]Incorrect assignment in object-generating

 

Hello,

Here you have inherit the product.supplierinfo object of product module
which has the table in database named "product_supplierinfo".

Generally when you are not giving the _table attribute explicitly it
will make the table of that object as _name and "." will be replaced by
"_".

So here in your new class, you gave the same name as inherited object.
This will result into override of table. So if you want to avoid such
things then please use the different name in _table attribute of your
new class or leave it as default. So in your case it will create the
table as "supplier_productinfo" instead of same name as in above object.

Hope this will help you.

Thanks.

** Changed in: openobject-server
       Status: New => Invalid

** Converted to question:
   https://answers.launchpad.net/openobject-server/+question/146244

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/719468

Title:
  [trunk6-dev]Incorrect assignment in object-generating

Status in OpenERP Server:
  Invalid

Bug description:
  class supplier_productinfo(osv.osv):
      _name = "supplier.productinfo"
      _inherit = "product.supplierinfo"
      _table = "product_supplierinfo"
      _description = "Information about a supplier product"

  
      _columns = {
          'code'                  : fields.related('product_id', type="many2one", relation="product.product", string='[Art.-Nummer] Bezeichnung'),
          'description_purchase'  : fields.text('Purchase Description',translate=True),
          'product_name2'         : fields.char('Zusatz', size=128),
          'price'                 : fields.related('pricelist_ids','price',type='float', string='Price'),
          'pricelist_ids'         : fields.one2many('pricelist.supplierproductinfo', 'suppinfo_id', 'Supplier Pricelist'),
      }

  
      _order = 'sequence'

  supplier_productinfo()

  In this new class, the 5 columns are associated to object "supplier.productinfo".
  But i find these cols in the inherited object "product.supplierinfo". This is wrong.
  In Openerp V5 it works fine.



References