It is currently Mon May 21, 2012 7:51 pm

All times are UTC + 2 hours




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: import products (importar productos)
PostPosted: Wed Apr 13, 2011 11:23 pm 
Offline

Joined: Thu Jul 29, 2010 11:17 pm
Posts: 11
any idea

La importación ha fallado debido a: Traceback (most recent call last): File "/usr/local/lib/python2.6/dist-packages/openerp-server/netsvc.py", line 489, in dispatch result = ExportService.getService(service_name).dispatch(method, auth, params) File "/usr/local/lib/python2.6/dist-packages/openerp-server/service/web_services.py", line 599, in dispatch res = fn(db, uid, *params) File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 122, in wrapper return f(self, dbname, *args, **kwargs) File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 176, in execute res = self.execute_cr(cr, uid, obj, method, *args, **kw) File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 167, in execute_cr return getattr(object, method)(cr, uid, *args, **kw) File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/orm.py", line 868, in import_data process_liness(self, datas, [], current_module, self._name, fields_def, position=position) File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/orm.py", line 801, in process_liness res2 = process_liness(self, datas, prefix + [field[len(prefix)]], current_module, relation_obj._name, newfd, pos, first) File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/orm.py", line 777, in process_liness if field[len(prefix)]=='id': IndexError: list index out of range


thank you so much


Top
 Profile  
 
 Post subject: Re: import products (importar productos)
PostPosted: Thu Apr 14, 2011 9:23 am 
Offline

Joined: Mon Apr 11, 2011 7:49 pm
Posts: 17
Location: Australia
Frankofe,

I think something wrong in your xml file.
Might need more info, if ya havn't figured it out yet.

8)


Top
 Profile  
 
 Post subject: Re: import products (importar productos)
PostPosted: Thu Apr 14, 2011 2:50 pm 
Offline

Joined: Thu Jul 29, 2010 11:17 pm
Posts: 11
thank you so much

this error i get when i try to import products with this fields

default_code (reference)
name (name)
categ_id (category)
procure_method
supply_method
purchase_ok
sale_ok
type
seller_ids
taxes_id client's taxes

thank you again


Top
 Profile  
 
 Post subject: Re: import products (importar productos)
PostPosted: Thu Apr 14, 2011 8:51 pm 
Offline

Joined: Mon Apr 11, 2011 7:49 pm
Posts: 17
Location: Australia
Frankofe,

Question, are you importing say like a excel file csv? or hav ya constructed a xml import file.??

Well if it was xml i would do this..
Code:
<openerp>
    <!-- #################################################################################### -->
    <data noupdate="1">
        <!-- ================================================================================ -->
        <record id="product_1" model="product.product">
       <field name="default_code">empty</field>
       <field name="name">empty</field>
       <field name="description">empty</field>
       <field name="description_purchase">empty</field>
       <field name="categ_id" ref="yourmodulename.product_category_name"/>
       <field name="supply_method">buy</field>
       <field name="procure_method">make_to_order</field>
       <field name="list_price">1000.00</field>
       <field name="standard_price">1000.00</field>
       <field name="sale_delay">1.0</field>
            <field name="uom_id" ref="product.product_uom_unit"/>
       <field name="uom_po_id" ref="product.product_uom_unit"/>
       <field name="type">consu</field>
       <field name="sale_ok" eval="False"/>
        </record>   
    </data>
    <!-- #################################################################################### -->
</openerp>


Hope that helps. 8)


Top
 Profile  
 
 Post subject: Re: import products (importar productos)
PostPosted: Thu Apr 14, 2011 11:09 pm 
Offline

Joined: Thu Jul 29, 2010 11:17 pm
Posts: 11
ok and so sorry
I'm trying to import from csv files

=) thank you


Top
 Profile  
 
 Post subject: Re: import products (importar productos)
PostPosted: Thu Apr 14, 2011 11:17 pm 
Offline

Joined: Thu Jul 29, 2010 11:17 pm
Posts: 11
i used this files in openerp 5.0.15 and didn't have this problem


Top
 Profile  
 
 Post subject: Re: import products (importar productos)
PostPosted: Thu Apr 14, 2011 11:36 pm 
Offline

Joined: Thu Jul 29, 2010 11:17 pm
Posts: 11
I have a question, there is a way to export in xml files from openerp


thank you again

Frankofe :D
Cali, Colombia


Top
 Profile  
 
 Post subject: Re: import products (importar productos)
PostPosted: Fri Apr 15, 2011 6:54 am 
Offline

Joined: Mon Apr 11, 2011 7:49 pm
Posts: 17
Location: Australia
Frankofe,

Depending on what Version ya using,, you should be checking ya source code
Addons / Products / product.py and maybe product_demo.xml for examples

Your old V5 csv, might need to be edited a little

Column Constraints below is for V6.0.2
Code:
'default_code' : fields.char('Reference', size=64),
'name': fields.char('Name', size=128, required=True, translate=True, select=True),

################################################################
I Think, the problem is here, I might be wrong? but try leaving this out.
From what I understand, this needs to be imported before importing your product
-----------------------------------
Code:
'categ_id': fields.many2one('product.category','Category', required=True, change_default=True, domain="[('type','=','normal')]" ,help="Select category"),

################################################################
Code:
'procure_method': fields.selection([('make_to_stock','Make to Stock'),('make_to_order','Make to Order')], 'Procurement Method', required=True),
'supply_method': fields.selection([('produce','Produce'),('buy','Buy')], 'Supply method', required=True),
'purchase_ok': fields.boolean('Can be Purchased'),
'sale_ok': fields.boolean('Can be Sold'),
'type': fields.selection([('product','Stockable Product'),('consu', 'Consumable'),('service','Service')], 'Product Type', required=True),

################################################################
I Think, the problem is here, I might be wrong? but try leaving this out.
From what I understand, this needs to be imported before importing your product
-----------------------------------
Code:
'seller_ids': fields.one2many('product.supplierinfo', 'product_id', 'Partners'),

################################################################
I Think, the problem is here, I might be wrong? but try leaving this out.
But u should be able to have ( Normal Taxes or Tax Exempt ) in your field, but could be wrong
-----------------------------------
From accounts
Code:
'taxes_id': fields.many2many('account.tax', 'product_taxes_rel',
            'prod_id', 'tax_id', 'Customer Taxes',
            domain=[('parent_id','=',False),('type_tax_use','in',['sale','all'])]),

################################################################
FYI - I dont use csv for importing data coz of all the issues with realation linking..
See how ya go leaving out ( categ_id/seller_ids / taxes_id ) out of csv 4 a test.
& if anyone out there know how to import one2many/many2many via csv, let him know.

Vitridex 8)


Top
 Profile  
 
 Post subject: Re: import products (importar productos)
PostPosted: Fri Apr 15, 2011 4:32 pm 
Offline

Joined: Thu Jul 29, 2010 11:17 pm
Posts: 11
Muchisimas gracias
Thank you so much

i felt the mistake, the problem is in the partner (in this case with seller_ids) the type and size was not the same

thank you again and best regards


Top
 Profile  
 
 Post subject: Re: import products (importar productos)
PostPosted: Mon Aug 15, 2011 5:48 pm 
Offline

Joined: Thu Aug 20, 2009 9:28 am
Posts: 16
Lo resolviste con los encabezados en ingles o en español ??
Saludos.


Top
 Profile  
 
 Post subject: Re: import products (importar productos)
PostPosted: Sun Sep 18, 2011 12:37 am 
Offline

Joined: Sun Sep 18, 2011 12:32 am
Posts: 15
De dónde se cambia el idioma del encabezado ?. File, User, Form, etc....


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC + 2 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:

Protected by Anti-Spam ACP