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
=== modified file 'l10n_ve_withholding_src/__openerp__.py'
--- l10n_ve_withholding_src/__openerp__.py 2012-01-27 15:31:37 +0000
+++ l10n_ve_withholding_src/__openerp__.py 2012-02-22 12:45:22 +0000
@@ -65,7 +65,6 @@
65 'view/account_invoice_view.xml',65 'view/account_invoice_view.xml',
66 'view/company_view.xml',66 'view/company_view.xml',
67 'workflow/l10n_ve_wh_src_wf.xml',67 'workflow/l10n_ve_wh_src_wf.xml',
68 'data/wh_src_sequence.xml',
69 'data/data.xml',68 'data/data.xml',
70 'wh_src_report.xml',69 'wh_src_report.xml',
71 ],70 ],
7271
=== modified file 'l10n_ve_withholding_src/data/data.xml'
--- l10n_ve_withholding_src/data/data.xml 2012-01-30 20:48:44 +0000
+++ l10n_ve_withholding_src/data/data.xml 2012-02-22 12:45:22 +0000
@@ -42,7 +42,26 @@
42 <field name="view_id" ref="account.account_journal_view"/>42 <field name="view_id" ref="account.account_journal_view"/>
43 <field name="sequence_id" ref="seq_account_retencion_src_customer"/>43 <field name="sequence_id" ref="seq_account_retencion_src_customer"/>
44 </record>44 </record>
45 45
46 <!-- Sequences type for account.wh.src -->
47
48
49 <record id="seq_type_account_wh_src_supplier" model="ir.sequence.type">
50 <field name="name">Withholding local.supplier</field>
51 <field name="code">account.wh.src.in_invoice</field>
52 </record>
53
54 <!-- Sequences for account.wh.src -->
55
56
57 <record id="seq_account_retencion_src_customer" model="ir.sequence">
58 <field name="name">Withholding local customer</field>
59 <field name="code">account.wh.src.in_invoice</field>
60 <field name="prefix">RET-SRC</field>
61 <field name="padding">8</field>
62 <field name="number_increment">1</field>
63 </record>
64
46 65
47 </data>66 </data>
48</openerp>67</openerp>
4968
=== removed file 'l10n_ve_withholding_src/data/wh_src_sequence.xml'
--- l10n_ve_withholding_src/data/wh_src_sequence.xml 2012-01-30 20:48:44 +0000
+++ l10n_ve_withholding_src/data/wh_src_sequence.xml 1970-01-01 00:00:00 +0000
@@ -1,26 +0,0 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data noupdate="1">
4
5 <!-- Sequences type for account.wh.src -->
6
7
8 <record id="seq_type_account_wh_src_supplier" model="ir.sequence.type">
9 <field name="name">Withholding local.supplier</field>
10 <field name="code">account.wh.src.in_invoice</field>
11 </record>
12
13 <!-- Sequences for account.wh.src -->
14
15
16 <record id="seq_account_retencion_src_customer" model="ir.sequence">
17 <field name="name">Withholding local customer</field>
18 <field name="code">account.wh.src.in_invoice</field>
19 <field name="prefix">RET-SRC</field>
20 <field name="padding">8</field>
21 <field name="number_increment">1</field>
22 </record>
23
24
25 </data>
26</openerp>
270
=== modified file 'l10n_ve_withholding_src/model/wh_src.py'
--- l10n_ve_withholding_src/model/wh_src.py 2012-02-20 13:57:58 +0000
+++ l10n_ve_withholding_src/model/wh_src.py 2012-02-22 12:45:22 +0000
@@ -125,9 +125,6 @@
125 125
126 wh_lines = ids and wh_line_obj.search(cr, uid, [('wh_id', '=', ids[0])]) or False126 wh_lines = ids and wh_line_obj.search(cr, uid, [('wh_id', '=', ids[0])]) or False
127 p_id_prv = ids and self.browse(cr, uid, ids[0], context=context).partner_id.id or False127 p_id_prv = ids and self.browse(cr, uid, ids[0], context=context).partner_id.id or False
128 print 'idssssssssss, ',ids
129 print 'partner_id, ',partner_id
130 print 'p_id_prv, ',p_id_prv
131 if wh_lines and p_id_prv != partner_id:128 if wh_lines and p_id_prv != partner_id:
132 wh_line_obj.unlink(cr, uid, wh_lines)129 wh_line_obj.unlink(cr, uid, wh_lines)
133 130
@@ -139,9 +136,6 @@
139 136
140137
141 def action_date_ret(self,cr,uid,ids,context=None):138 def action_date_ret(self,cr,uid,ids,context=None):
142 #~ TO-CHECK
143 #~ SI EL DOCUMENTO YA TIENE FECHA SE DEVUELVE LA MISMA FECHA,
144 #~ NO SE DEBE HACER NADA
145 for wh in self.browse(cr, uid, ids, context):139 for wh in self.browse(cr, uid, ids, context):
146 wh.date_ret or self.write(cr, uid, [wh.id], {'date_ret':time.strftime('%Y-%m-%d')})140 wh.date_ret or self.write(cr, uid, [wh.id], {'date_ret':time.strftime('%Y-%m-%d')})
147 return True141 return True
@@ -150,7 +144,6 @@
150 def action_draft(self, cr, uid, ids, context={}):144 def action_draft(self, cr, uid, ids, context={}):
151 if context is None:145 if context is None:
152 context={}146 context={}
153 print 'ENTROOOOOO EN SET TO DRAFT'
154 inv_obj = self.pool.get('account.invoice')147 inv_obj = self.pool.get('account.invoice')
155 148
156 brw = self.browse(cr,uid,ids[0],context)149 brw = self.browse(cr,uid,ids[0],context)
@@ -190,7 +183,7 @@
190 def action_done(self, cr, uid, ids, context=None):183 def action_done(self, cr, uid, ids, context=None):
191 if context is None:184 if context is None:
192 context = {}185 context = {}
193 #~ 186
194 self.action_date_ret(cr, uid, ids, context=context)187 self.action_date_ret(cr, uid, ids, context=context)
195 self.action_number(cr, uid, ids)188 self.action_number(cr, uid, ids)
196 self.action_move_create(cr, uid, ids, context=context)189 self.action_move_create(cr, uid, ids, context=context)
@@ -219,11 +212,7 @@
219 context.update({'src_wh':True})212 context.update({'src_wh':True})
220 213
221 ret = self.browse(cr, uid, ids[0], context)214 ret = self.browse(cr, uid, ids[0], context)
222 #~ TO-CHECK 215
223 #~ SI EL DOCUMENTO YA TIENE UN ASIENTO CONTABLE,
224 #~ PRIMERO SE DEBE DESTRUIR, Y ANTES DE DESTRUIR,
225 #~ SE DEBE CUMPLIR CON UNA SERIE DE CONDICIONES
226 #~ PARA SU DESTRUCCION
227 for line in ret.line_ids:216 for line in ret.line_ids:
228 if line.move_id:217 if line.move_id:
229 raise osv.except_osv(_('Invoice already withhold !'),\218 raise osv.except_osv(_('Invoice already withhold !'),\
@@ -268,20 +257,20 @@
268 return True257 return True
269258
270 def action_number(self, cr, uid, ids, *args):259 def action_number(self, cr, uid, ids, *args):
271 #~ TO-CHECK
272 #~ SI EL DOCUMENTO YA TIENE NUMERO
273 #~ SE DEVUELVE TRUE UNA VEZ
274 obj_ret = self.browse(cr, uid, ids)[0]260 obj_ret = self.browse(cr, uid, ids)[0]
275 if obj_ret.type == 'in_invoice':261 if obj_ret.type == 'in_invoice':
276 cr.execute('SELECT id, number ' \262 cr.execute('SELECT id, number ' \
277 'FROM account_wh_src ' \263 'FROM account_wh_src ' \
278 'WHERE id IN ('+','.join(map(str,ids))+')')264 'WHERE id IN ('+','.join(map(str,ids))+')')
279265
266
280 for (id, number) in cr.fetchall():267 for (id, number) in cr.fetchall():
281 if not number:268 if not number:
282 number = self.pool.get('ir.sequence').get(cr, uid, 'account.wh.src.%s' % obj_ret.type)269 number = self.pool.get('ir.sequence').get(cr, uid, 'account.wh.src.%s' % obj_ret.type)
283 cr.execute('UPDATE account_wh_src SET number=%s ' \270 cr.execute('UPDATE account_wh_src SET number=%s ' \
284 'WHERE id=%s', (number, id))271 'WHERE id=%s', (number, id))
272
273
285 return True274 return True
286 275
287 276