Merge lp:~altegra/pepess/pepess_dev_carlos_scripts into lp:pepess

Status: Merged
Merged at revision: 74
Proposed branch: lp:~altegra/pepess/pepess_dev_carlos_scripts
Merge into: lp:pepess
Diff against target: 88 lines (+79/-0)
2 files modified
scripts/add_tax_porduct_shop.py (+47/-0)
scripts/remove_product_companyid.py (+32/-0)
To merge this branch: bzr merge lp:~altegra/pepess/pepess_dev_carlos_scripts
Reviewer Review Type Date Requested Status
Moisés López - http://www.vauxoo.com Approve
Review via email: mp+239325@code.launchpad.net

Description of the change

[ADD] Scripts are added to update the company's products = False and added script that add new tax to products

To post a comment you must log in.
Revision history for this message
Moisés López - http://www.vauxoo.com (moylop260) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'scripts/add_tax_porduct_shop.py'
--- scripts/add_tax_porduct_shop.py 1970-01-01 00:00:00 +0000
+++ scripts/add_tax_porduct_shop.py 2014-10-22 22:21:47 +0000
@@ -0,0 +1,47 @@
1# -*- coding: UTF-8 -*-
2
3#############################################################################
4# Agrega los impuestos de la tienda a todos los productos ya agregados en Pepess
5#############################################################################
6
7import xmlrpclib
8import base64
9
10#######################################################################
11# Conexión a OPENERP PEPESS #
12#######################################################################
13
14# Acceso a OpenERP
15username_pepess = ''
16pwd_pepess = ''
17dbname_pepess = ''
18
19# Obtenemos acceso a Open ERP
20urlopen_pepess = ""
21
22#~ sock_common_pepess = xmlrpclib.ServerProxy ('http://'+urlopen_pepess+':9069/xmlrpc/common')
23#~ uid_pepess = sock_common_pepess.login(dbname_pepess, username_pepess, pwd_pepess)
24#~ sock_pepess = xmlrpclib.ServerProxy('http://'+urlopen_pepess+':9069/xmlrpc/object')
25
26##########################################################################################
27# ID de los impuestos a asignar
28##########################################################################################
29
30sale_tax = 0
31pruchase_tax = 0
32
33##########################################################################################
34#
35##########################################################################################
36
37#~ product_ids = sock_pepess.execute(dbname_pepess, uid_pepess, pwd_pepess, 'product.product', 'search', [])
38#~ print len(product_ids),"prodcutos"
39#~ update = sock_pepess.execute(dbname_pepess, uid_pepess, pwd_pepess, 'product.product', 'write', product_ids, {'taxes_id':[(4, sale_tax)],'supplier_taxes_id':[(4, pruchase_tax)]})
40#~ print "FIN"
41
42producto = xmlrpclib.Binary(base64.b64encode(open('/home/daimon/pepess.png', 'rb').read()))
43producto2 = base64.b64encode(open('/home/daimon/pepess.png', 'rb').read())
44
45#~ print producto
46print "----------------------------------------------------------------------------------------------------------------"
47print producto2
048
=== added file 'scripts/remove_product_companyid.py'
--- scripts/remove_product_companyid.py 1970-01-01 00:00:00 +0000
+++ scripts/remove_product_companyid.py 2014-10-22 22:21:47 +0000
@@ -0,0 +1,32 @@
1# -*- coding: UTF-8 -*-
2
3#############################################################################
4# Actualiza el campo company_id del producto a FALSE
5#############################################################################
6
7import xmlrpclib
8
9#######################################################################
10# Conexión a OPENERP PEPESS #
11#######################################################################
12
13# Acceso a OpenERP
14username_pepess = ''
15pwd_pepess = ''
16dbname_pepess = ''
17
18# Obtenemos acceso a Open ERP
19urlopen_pepess = ""
20
21sock_common_pepess = xmlrpclib.ServerProxy ('http://'+urlopen_pepess+':10069/xmlrpc/common')
22uid_pepess = sock_common_pepess.login(dbname_pepess, username_pepess, pwd_pepess)
23sock_pepess = xmlrpclib.ServerProxy('http://'+urlopen_pepess+':10069/xmlrpc/object')
24
25##########################################################################################
26#
27##########################################################################################
28
29product_ids = sock_pepess.execute(dbname_pepess, uid_pepess, pwd_pepess, 'product.product', 'search', [])
30print len(product_ids),"prodcutos"
31update = sock_pepess.execute(dbname_pepess, uid_pepess, pwd_pepess, 'product.product', 'write', product_ids, {'company_id':False})
32print "FIN"

Subscribers

People subscribed via source and target branches

to all changes: