Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
5836 Vizualizări

Hi all,

I'm trying to add product.attributes to my products via my own module, but I'm lost.

I've found the product.attribute class in /addons/product/product.py but theres no documentation on how to add them.

I'm trying to add them to my product.template custom module ( i've extend the product.template class )

I've tried: self.pool.get('product.attribute').write() but that didn't work. The attributes are not showing up by the product and can't be found under: Sales > Configuration > Product categories & Attributes > Attributes.

i'm using the new odoo V8 version.

Imagine profil
Abandonează
Cel mai bun răspuns

Not quite sure what you are trying to achieve here? Do you want to add new fields, such as "name" and others?

If so, just follow this guide:

http://www.slideshare.net/openobject/odoo-from-v7-to-v8-the-new-api

If you want to actually create the records for products in a database, you should use the create function, i.e. "self.pool.get('product.product').create(vals).

[EDIT]

First example is something like

class myproduct(model.Models)

    _name = 'product.product'

    _inherit = 'product.product'

    some_prop = fields.Char(string = 'Some property')

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
2
mai 16
8641
1
mar. 15
4140
1
mai 25
797
0
ian. 24
1562
2
aug. 23
2270