← Back to team overview

c2c-oerpscenario team mailing list archive

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

 

On Monday 21 February 2011, you wrote:

> I am not a expert in the openerp-programming, but that has in openerp V5
> works very well. 
It just happened that it didn't screw your tables in v5. But was never 
designed to work like that.

> I expect only that the fields associated with the correct object
> If the tables are strong assigned to the object(name)- i think the
> specification of _table is unnecessary.
The '_table' attribute in models is there for another reason: it allows us to 
rename a few models while keeping a historic name of the table (it had 
happened somewhere in v4.2->v5.0 or earlier, and has not been used at any 
recent case AFAIK).
On the other hand, if you had strongly wanted to have some pseydo-model which 
has no table (but reads the data of another one), you should have also set 
'_auto = False' at that model, which means it won't try to maintain its 
'_table'. We use that for views, for example. 
But, unless you have a strong reason to do so, please avoid all this. It's a 
mess in your schema.

-- 
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