Merge lp:~vauxoo/openerp-venezuela-localization/marvi-joyza-src-withholding into lp:~openerp-venezuela/openerp-venezuela-localization/6.0-trunk

Proposed by [SISB] Marvi Diaz
Status: Merged
Merged at revision: 624
Proposed branch: lp:~vauxoo/openerp-venezuela-localization/marvi-joyza-src-withholding
Merge into: lp:~openerp-venezuela/openerp-venezuela-localization/6.0-trunk
Diff against target: 150 lines (+25/-44)
4 files modified
l10n_ve_withholding_src/__openerp__.py (+0/-1)
l10n_ve_withholding_src/data/data.xml (+20/-1)
l10n_ve_withholding_src/data/wh_src_sequence.xml (+0/-26)
l10n_ve_withholding_src/model/wh_src.py (+5/-16)
To merge this branch: bzr merge lp:~vauxoo/openerp-venezuela-localization/marvi-joyza-src-withholding
Reviewer Review Type Date Requested Status
hbto [Vauxoo] http://www.vauxoo.com Pending
Review via email: mp+94144@code.launchpad.net

This proposal supersedes a proposal from 2012-02-22.

Description of the change

[IMP]modificacion sobre el modulo de src

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'l10n_ve_withholding_src/__openerp__.py'
2--- l10n_ve_withholding_src/__openerp__.py 2012-01-27 15:31:37 +0000
3+++ l10n_ve_withholding_src/__openerp__.py 2012-02-22 12:45:22 +0000
4@@ -65,7 +65,6 @@
5 'view/account_invoice_view.xml',
6 'view/company_view.xml',
7 'workflow/l10n_ve_wh_src_wf.xml',
8- 'data/wh_src_sequence.xml',
9 'data/data.xml',
10 'wh_src_report.xml',
11 ],
12
13=== modified file 'l10n_ve_withholding_src/data/data.xml'
14--- l10n_ve_withholding_src/data/data.xml 2012-01-30 20:48:44 +0000
15+++ l10n_ve_withholding_src/data/data.xml 2012-02-22 12:45:22 +0000
16@@ -42,7 +42,26 @@
17 <field name="view_id" ref="account.account_journal_view"/>
18 <field name="sequence_id" ref="seq_account_retencion_src_customer"/>
19 </record>
20-
21+
22+ <!-- Sequences type for account.wh.src -->
23+
24+
25+ <record id="seq_type_account_wh_src_supplier" model="ir.sequence.type">
26+ <field name="name">Withholding local.supplier</field>
27+ <field name="code">account.wh.src.in_invoice</field>
28+ </record>
29+
30+ <!-- Sequences for account.wh.src -->
31+
32+
33+ <record id="seq_account_retencion_src_customer" model="ir.sequence">
34+ <field name="name">Withholding local customer</field>
35+ <field name="code">account.wh.src.in_invoice</field>
36+ <field name="prefix">RET-SRC</field>
37+ <field name="padding">8</field>
38+ <field name="number_increment">1</field>
39+ </record>
40+
41
42 </data>
43 </openerp>
44
45=== removed file 'l10n_ve_withholding_src/data/wh_src_sequence.xml'
46--- l10n_ve_withholding_src/data/wh_src_sequence.xml 2012-01-30 20:48:44 +0000
47+++ l10n_ve_withholding_src/data/wh_src_sequence.xml 1970-01-01 00:00:00 +0000
48@@ -1,26 +0,0 @@
49-<?xml version="1.0" encoding="utf-8"?>
50-<openerp>
51- <data noupdate="1">
52-
53- <!-- Sequences type for account.wh.src -->
54-
55-
56- <record id="seq_type_account_wh_src_supplier" model="ir.sequence.type">
57- <field name="name">Withholding local.supplier</field>
58- <field name="code">account.wh.src.in_invoice</field>
59- </record>
60-
61- <!-- Sequences for account.wh.src -->
62-
63-
64- <record id="seq_account_retencion_src_customer" model="ir.sequence">
65- <field name="name">Withholding local customer</field>
66- <field name="code">account.wh.src.in_invoice</field>
67- <field name="prefix">RET-SRC</field>
68- <field name="padding">8</field>
69- <field name="number_increment">1</field>
70- </record>
71-
72-
73- </data>
74-</openerp>
75
76=== modified file 'l10n_ve_withholding_src/model/wh_src.py'
77--- l10n_ve_withholding_src/model/wh_src.py 2012-02-20 13:57:58 +0000
78+++ l10n_ve_withholding_src/model/wh_src.py 2012-02-22 12:45:22 +0000
79@@ -125,9 +125,6 @@
80
81 wh_lines = ids and wh_line_obj.search(cr, uid, [('wh_id', '=', ids[0])]) or False
82 p_id_prv = ids and self.browse(cr, uid, ids[0], context=context).partner_id.id or False
83- print 'idssssssssss, ',ids
84- print 'partner_id, ',partner_id
85- print 'p_id_prv, ',p_id_prv
86 if wh_lines and p_id_prv != partner_id:
87 wh_line_obj.unlink(cr, uid, wh_lines)
88
89@@ -139,9 +136,6 @@
90
91
92 def action_date_ret(self,cr,uid,ids,context=None):
93- #~ TO-CHECK
94- #~ SI EL DOCUMENTO YA TIENE FECHA SE DEVUELVE LA MISMA FECHA,
95- #~ NO SE DEBE HACER NADA
96 for wh in self.browse(cr, uid, ids, context):
97 wh.date_ret or self.write(cr, uid, [wh.id], {'date_ret':time.strftime('%Y-%m-%d')})
98 return True
99@@ -150,7 +144,6 @@
100 def action_draft(self, cr, uid, ids, context={}):
101 if context is None:
102 context={}
103- print 'ENTROOOOOO EN SET TO DRAFT'
104 inv_obj = self.pool.get('account.invoice')
105
106 brw = self.browse(cr,uid,ids[0],context)
107@@ -190,7 +183,7 @@
108 def action_done(self, cr, uid, ids, context=None):
109 if context is None:
110 context = {}
111- #~
112+
113 self.action_date_ret(cr, uid, ids, context=context)
114 self.action_number(cr, uid, ids)
115 self.action_move_create(cr, uid, ids, context=context)
116@@ -219,11 +212,7 @@
117 context.update({'src_wh':True})
118
119 ret = self.browse(cr, uid, ids[0], context)
120- #~ TO-CHECK
121- #~ SI EL DOCUMENTO YA TIENE UN ASIENTO CONTABLE,
122- #~ PRIMERO SE DEBE DESTRUIR, Y ANTES DE DESTRUIR,
123- #~ SE DEBE CUMPLIR CON UNA SERIE DE CONDICIONES
124- #~ PARA SU DESTRUCCION
125+
126 for line in ret.line_ids:
127 if line.move_id:
128 raise osv.except_osv(_('Invoice already withhold !'),\
129@@ -268,20 +257,20 @@
130 return True
131
132 def action_number(self, cr, uid, ids, *args):
133- #~ TO-CHECK
134- #~ SI EL DOCUMENTO YA TIENE NUMERO
135- #~ SE DEVUELVE TRUE UNA VEZ
136 obj_ret = self.browse(cr, uid, ids)[0]
137 if obj_ret.type == 'in_invoice':
138 cr.execute('SELECT id, number ' \
139 'FROM account_wh_src ' \
140 'WHERE id IN ('+','.join(map(str,ids))+')')
141
142+
143 for (id, number) in cr.fetchall():
144 if not number:
145 number = self.pool.get('ir.sequence').get(cr, uid, 'account.wh.src.%s' % obj_ret.type)
146 cr.execute('UPDATE account_wh_src SET number=%s ' \
147 'WHERE id=%s', (number, id))
148+
149+
150 return True
151
152