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
1=== added file 'scripts/add_tax_porduct_shop.py'
2--- scripts/add_tax_porduct_shop.py 1970-01-01 00:00:00 +0000
3+++ scripts/add_tax_porduct_shop.py 2014-10-22 22:21:47 +0000
4@@ -0,0 +1,47 @@
5+# -*- coding: UTF-8 -*-
6+
7+#############################################################################
8+# Agrega los impuestos de la tienda a todos los productos ya agregados en Pepess
9+#############################################################################
10+
11+import xmlrpclib
12+import base64
13+
14+#######################################################################
15+# Conexión a OPENERP PEPESS #
16+#######################################################################
17+
18+# Acceso a OpenERP
19+username_pepess = ''
20+pwd_pepess = ''
21+dbname_pepess = ''
22+
23+# Obtenemos acceso a Open ERP
24+urlopen_pepess = ""
25+
26+#~ sock_common_pepess = xmlrpclib.ServerProxy ('http://'+urlopen_pepess+':9069/xmlrpc/common')
27+#~ uid_pepess = sock_common_pepess.login(dbname_pepess, username_pepess, pwd_pepess)
28+#~ sock_pepess = xmlrpclib.ServerProxy('http://'+urlopen_pepess+':9069/xmlrpc/object')
29+
30+##########################################################################################
31+# ID de los impuestos a asignar
32+##########################################################################################
33+
34+sale_tax = 0
35+pruchase_tax = 0
36+
37+##########################################################################################
38+#
39+##########################################################################################
40+
41+#~ product_ids = sock_pepess.execute(dbname_pepess, uid_pepess, pwd_pepess, 'product.product', 'search', [])
42+#~ print len(product_ids),"prodcutos"
43+#~ 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)]})
44+#~ print "FIN"
45+
46+producto = xmlrpclib.Binary(base64.b64encode(open('/home/daimon/pepess.png', 'rb').read()))
47+producto2 = base64.b64encode(open('/home/daimon/pepess.png', 'rb').read())
48+
49+#~ print producto
50+print "----------------------------------------------------------------------------------------------------------------"
51+print producto2
52
53=== added file 'scripts/remove_product_companyid.py'
54--- scripts/remove_product_companyid.py 1970-01-01 00:00:00 +0000
55+++ scripts/remove_product_companyid.py 2014-10-22 22:21:47 +0000
56@@ -0,0 +1,32 @@
57+# -*- coding: UTF-8 -*-
58+
59+#############################################################################
60+# Actualiza el campo company_id del producto a FALSE
61+#############################################################################
62+
63+import xmlrpclib
64+
65+#######################################################################
66+# Conexión a OPENERP PEPESS #
67+#######################################################################
68+
69+# Acceso a OpenERP
70+username_pepess = ''
71+pwd_pepess = ''
72+dbname_pepess = ''
73+
74+# Obtenemos acceso a Open ERP
75+urlopen_pepess = ""
76+
77+sock_common_pepess = xmlrpclib.ServerProxy ('http://'+urlopen_pepess+':10069/xmlrpc/common')
78+uid_pepess = sock_common_pepess.login(dbname_pepess, username_pepess, pwd_pepess)
79+sock_pepess = xmlrpclib.ServerProxy('http://'+urlopen_pepess+':10069/xmlrpc/object')
80+
81+##########################################################################################
82+#
83+##########################################################################################
84+
85+product_ids = sock_pepess.execute(dbname_pepess, uid_pepess, pwd_pepess, 'product.product', 'search', [])
86+print len(product_ids),"prodcutos"
87+update = sock_pepess.execute(dbname_pepess, uid_pepess, pwd_pepess, 'product.product', 'write', product_ids, {'company_id':False})
88+print "FIN"

Subscribers

People subscribed via source and target branches

to all changes: