Community: Framework mailing list archives

expert-framework@mail.odoo.com

Re: Community: Framework

by
omar
- 04/27/2016 05:55:06
my object is to create a module to display all product variant so I chose a product template
i try this code aims do not function
class.py

product_mod class (models.Model)
    _name = "product.product.inherit"
    _inherit = "product.product"
      produit_templet = fields.Many2one ( "product.template")
    var = fields.One2many ( "product.product ',' name ')
    @ api.multi
    def produit_get_var (self):
        produit_obj self.env = [ 'product.product']
        self.pr
        produit_obj.search products = ([( 'product_templ_id', '==' self.produit_templet.id)])
        i = 1
        for products produced in:
            
            produit.write ({ 'id': [(0.0, { 'produit.id' :( i)})]})
            i + = 1
        return True

view.xml

<Button name = "produit_get_var" type = "object" string = "product var" class = "oe_highlight oe_inline" />
<Notebook>
<String page = "variant product">
<Field name = "var">
<Tree create = "false" delete = "false" editable = "bottom">
<Field name = 'name' />
</ Tree>
<Form>
<Group>
<Field name = 'name' />
</ Group> </ form>
</ Field>
</ Page> </ notebook>

how i do doing in this position