Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

insert values in many2many product.attribute

By
lallouch
on 4/14/15, 3:36 AM 1,126 views

hi,

i want to insert values in product.template.attribute_line_ids. i try to insert 


line_id=self.pool.get('product.attribute.line').search(cr, uid,([('product_tmpl_id','=', product_tmpl_id),('attribute_id','=',modelcolor_id[0])])) 

if line_id:

values={'id':color_id, 'attribute_id': modelcolor_id[0],'name':color }

colors=line_id.value_id

self.pool.get('product.attribute.line').write(cr, uid,line_id ,{'value_ids': [(1, line_id, {values})]})


can you help me

0
lallouch
On 4/14/15, 5:50 AM

hi

i have this error


env.prefetch[cls._name].update(ids)

TypeError: unhashable type: 'list'

Hi, I have updated my answer. Please try it.

Emipro Technologies Pvt. Ltd.
on 4/16/15, 2:06 AM
hi
thanks for your replay but i have this error

 File "/opt/openerp/odoo/openerp/models.py", line 3778, in _write

    raise MissingError(_('One of the records you are trying to modify has already been deleted (Document type: %s).') % self._description)

MissingError: ('MissingError', 'One of the records you are trying to modify has already been deleted (Document type: product.attribute.value).')


my code is: 

line_id=self.pool.get('product.attribute.line').search(cr, uid,([('product_tmpl_id','=', product_tmpl_id),('attribute_id','=',modelcolor_id[0])]))                                    

                                if line_id:

                                    values={'id':color_id, 'attribute_id': modelcolor_id[0],'name':color }

                                    self.pool.get('product.attribute.line').write(cr, uid,line_id ,{'value_ids': [(1, line_id[0], values ) ] })

thanks


Cordialement,


Tarik Sindi Lallouch
General Manager

PLVDESIGN - SPRINT
15 rue des Asphodeles
Casablanca - Maroc
tariklallouch@plvsprint.com

2015-04-16 7:06 GMT+01:00 Emipro Technologies Pvt. Ltd. <hiren@emiprotechnologies.com>:

Hi, I have updated my answer. Please try it.

Emipro Technologies is best in Odoo & eCommerce Application development based outsourcing software firm. We deliver any kind of complex solutions in the domain of Odoo and eCommerce to customers accross the globe. Being in IT business since 2011, We have a strong team of skilled experienced IT experts.Our customers are companies of all sizes ranging from startups to large enterprises who realize that they need a professional internet solution to generate revenue streams, establish communication channels or streamline business operations.

Our Services in Odoo includes,
  • Installation
  • Customization
  • Configuration
  • Software Training
  • After Sale Support
  • Maintenance
  • Consulting
Contact info@emiprotechnologies.com for any kind of queries in Odoo. Visit www.emiprotechnologies.com for more details.




 

Sent by Tiny ERP Pvt Ltd using Odoo access your messages

tariklallouch
on 4/16/15, 3:18 AM
0

Emipro Technologies Pvt. Ltd.

--Emipro Technologies Pvt. Ltd.--
Tiny ERP Pvt Ltd
http://www.odoo.com
5975
| 6 7 8
Rajkot, India
--Emipro Technologies Pvt. Ltd.--

Being an emerging leader in IT market since 2011, Emipro Technologies Pvt. Ltd. has been providing a wide range of business solutions in Odoo & Magento. We are pleased to have a large pool of contented customers with our meticulous work in the domain of ERP & e-Commerce. A ray of relief & satisfaction to  our customers heart by our successful deployment in their organization, purely represents our success in Odoo platform. Hence, we take pride for being an Odoo partner with a vision of expanding our strategic alliances with our customers to offer them high value-added, trustworthy & cost effective solutions.

 

Since establishment, our business has span across 11 countries of the world. Our customers are companies of all sizes ranging from start-ups to large enterprises, who realize that they need a professional business solutions to generate revenue streams, establish proper communication channels or streamline business operations. Standing with strong determination of customer satisfaction, observing each minute detail of their business processes, providing proper guidance and moving forth to develop product accordingly adds our value and reliability among our customers. 

 

We are blessed with efficient, passionate & eclectic young developers who have come across almost all kinds of business profiles, working with full dedication, applying creativity & new features in existing modules and completing customer's projects successfully on predefined target. Our in-depth knowledge while giving business solutions in Odoo allows us to offer following services to our customers :

 

  • Consulting
  • Installation, Configuration & Customization
  • Training & Support
  • Maintenance
  • Upgradation
  • Documentation
  • Crafting community modules
  • Drafting videos on demand
  • Smart Apps development

We will be :) to welcome you @ www.emiprotechnologies.com to solve any kind of your business needs around Odoo. However we are just an inch away from you by email info@emiprotechnologies.com or a tweet to @EmiproTech

Emipro Technologies Pvt. Ltd.
On 4/14/15, 5:21 AM

Hi,

just update your last line with the following. 

self.pool.get('product.attribute.line').write(cr, uid,line_id ,{'value_ids': [(1, line_id[0], values ) ] }) # Here we have to pass dict and your values is it self dict. Here we just need to give one ID.

I hope issue will resolve.


Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 4/14/15, 3:36 AM
Seen: 1126 times
Last updated: 4/14/15, 10:40 AM