Merge lp:~vauxoo/openerp-venezuela-localization/hbto_wkf-wh-fix into lp:~openerp-venezuela/openerp-venezuela-localization/6.0-trunk

Proposed by hbto [Vauxoo] http://www.vauxoo.com
Status: Merged
Merged at revision: 459
Proposed branch: lp:~vauxoo/openerp-venezuela-localization/hbto_wkf-wh-fix
Merge into: lp:~openerp-venezuela/openerp-venezuela-localization/6.0-trunk
Diff against target: 220 lines (+125/-27)
5 files modified
l10n_ve_withholding/__openerp__.py (+2/-1)
l10n_ve_withholding/workflow/account_workflow.xml (+22/-0)
l10n_ve_withholding_islr/invoice.py (+65/-18)
l10n_ve_withholding_islr/workflow/account_workflow.xml (+33/-5)
l10n_ve_withholding_iva/account_workflow.xml (+3/-3)
To merge this branch: bzr merge lp:~vauxoo/openerp-venezuela-localization/hbto_wkf-wh-fix
Reviewer Review Type Date Requested Status
Nhomar - Vauxoo merged Approve
Review via email: mp+80782@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Nhomar - Vauxoo (nhomar) wrote :

Por mi esta muy bien, creo que el resultado final es un buen merge de todos los conceptos discutidos, estoy haciendo el merge, ya lo probe en mi instancia y funciono perfecto.

review: Approve (merged)
Revision history for this message
Nhomar - Vauxoo (nhomar) wrote :

Hare otra propuesta de merge con el asunto de las vistas solamente

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'l10n_ve_withholding/__openerp__.py'
2--- l10n_ve_withholding/__openerp__.py 2011-10-25 20:33:16 +0000
3+++ l10n_ve_withholding/__openerp__.py 2011-10-31 09:06:24 +0000
4@@ -45,7 +45,8 @@
5 'security/ir.model.access.csv',
6 'l10n_ve_withholding_data.xml',
7 'l10n_ve_withholding_view.xml',
8- 'account_view.xml'
9+ 'account_view.xml',
10+ 'workflow/account_workflow.xml',
11 ],
12 'demo_xml': [],
13 'test': [],
14
15=== added directory 'l10n_ve_withholding/workflow'
16=== added file 'l10n_ve_withholding/workflow/account_workflow.xml'
17--- l10n_ve_withholding/workflow/account_workflow.xml 1970-01-01 00:00:00 +0000
18+++ l10n_ve_withholding/workflow/account_workflow.xml 2011-10-31 09:06:24 +0000
19@@ -0,0 +1,22 @@
20+<?xml version="1.0" encoding="utf-8"?>
21+<openerp>
22+ <data>
23+ #----------------------------------------------
24+ # Activity
25+ #----------------------------------------------
26+ <record id="act_wh_router" model="workflow.activity">
27+ <field name="wkf_id" ref="account.wkf"/>
28+ <field name="name">wh_router</field>
29+ <field name="kind">dummy</field>
30+ <field name="split_mode">OR</field>
31+ </record>
32+ #----------------------------------------------
33+ # Transitions
34+ #----------------------------------------------
35+ <record id="trans_open_wh_router" model="workflow.transition">
36+ <field name="act_from" ref="account.act_open"/>
37+ <field name="act_to" ref="act_wh_router"/>
38+ <field name="condition">True</field>
39+ </record>
40+ </data>
41+</openerp>
42
43=== modified file 'l10n_ve_withholding_islr/invoice.py'
44--- l10n_ve_withholding_islr/invoice.py 2011-10-31 04:58:31 +0000
45+++ l10n_ve_withholding_islr/invoice.py 2011-10-31 09:06:24 +0000
46@@ -575,13 +575,10 @@
47 def action_ret_islr(self, cr, uid, ids, context={}):
48 return self.pool.get('islr.wh.doc').action_ret_islr(cr,uid,ids,context)
49
50- def check_wh_islr_apply(self, cr, uid, ids, context=None):
51- '''
52- This Method test if given certain conditions it is
53- possible to create a new withholding document
54- '''
55+ def _check_wh_islr(self, cr, uid, ids, context=None):
56 if context is None:
57 context={}
58+
59 wh_apply=[]
60 # The two function being called below should undergo overhauling
61 # right now it takes an object as and argument instead of an integer
62@@ -591,19 +588,69 @@
63 wh_apply.append(wh)
64 wh_apply.append(concept_list)
65
66- inv_brw = False
67- if all(wh_apply):
68- wh_dict = self._get_service_wh(cr, uid, invoice, concept_list)
69- residence = self._get_residence(cr, uid, vendor, buyer)
70- nature = self._get_nature(cr, uid, vendor)
71- dict_rate = self._get_rate_dict(cr, uid, concept_list, residence, nature,context=context)
72- self._pop_dict(cr,uid,concept_list,dict_rate,wh_dict)
73- context.update({'test_from_wkf':True})
74- dict_completo = self._get_wh_apply(cr,uid,dict_rate,wh_dict,nature,context=context)
75- inv_brw = self._get_inv_id(cr,uid,dict_completo)
76-
77- wh_apply.append(inv_brw)
78- return all(wh_apply)
79+ return invoice, vendor, buyer, concept_list, all(wh_apply)
80+
81+ def _check_do_wh(self, cr, uid, ids, invoice, vendor, buyer, concept_list, context=None):
82+ if context is None:
83+ context={}
84+ wh_dict = self._get_service_wh(cr, uid, invoice, concept_list)
85+ residence = self._get_residence(cr, uid, vendor, buyer)
86+ nature = self._get_nature(cr, uid, vendor)
87+ dict_rate = self._get_rate_dict(cr, uid, concept_list, residence, nature,context=context)
88+ self._pop_dict(cr,uid,concept_list,dict_rate,wh_dict)
89+ dict_completo = self._get_wh_apply(cr,uid,dict_rate,wh_dict,nature,context=context)
90+ inv_brw = self._get_inv_id(cr,uid,dict_completo)
91+
92+ return bool(inv_brw)
93+
94+ def check_wh_islr_apply(self, cr, uid, ids, context=None):
95+ '''
96+ This Method test if given certain conditions it is
97+ possible to create a new withholding document
98+ '''
99+ if context is None:
100+ context={}
101+
102+ invoice, vendor, buyer, concept_list, wh_apply = self._check_wh_islr(cr, uid, ids, context=context)
103+
104+ do_wh = False
105+ if wh_apply:
106+ context.update({'test_from_wkf':True})
107+ do_wh = self._check_do_wh(cr, uid, ids, invoice, vendor, buyer, concept_list, context=context)
108+
109+ return all([wh_apply,do_wh])
110+
111+ def check_wh_islr_xml(self, cr, uid, ids, context=None):
112+ '''
113+ This Method test if given certain conditions it is
114+ __not__ possible to create a new withholding document
115+ but the xml elements needed to create a legal report
116+ '''
117+ if context is None:
118+ context={}
119+
120+ invoice, vendor, buyer, concept_list, wh_apply = self._check_wh_islr(cr, uid, ids, context=context)
121+
122+ do_wh = True
123+ if wh_apply:
124+ context.update({'test_from_wkf':True})
125+ do_wh = self._check_do_wh(cr, uid, ids, invoice, vendor, buyer, concept_list, context=context)
126+
127+ return all([wh_apply,not do_wh])
128+
129+ def action_islr_xml(self, cr, uid, ids, context=None):
130+ '''
131+ This Method creates the xml elements needed to provide a legal report
132+ '''
133+ if context is None:
134+ context={}
135+
136+ invoice, vendor, buyer, concept_list, wh_apply = self._check_wh_islr(cr, uid, ids, context=context)
137+
138+ if wh_apply:
139+ self._check_do_wh(cr, uid, ids, invoice, vendor, buyer, concept_list, context=context)
140+
141+ return True
142
143 account_invoice()
144
145
146=== modified file 'l10n_ve_withholding_islr/workflow/account_workflow.xml'
147--- l10n_ve_withholding_islr/workflow/account_workflow.xml 2011-10-31 01:02:55 +0000
148+++ l10n_ve_withholding_islr/workflow/account_workflow.xml 2011-10-31 09:06:24 +0000
149@@ -17,7 +17,19 @@
150 <field name="action">action_ret_islr()</field>
151 </record>
152
153-
154+ <record id="act_islr_router" model="workflow.activity">
155+ <field name="wkf_id" ref="account.wkf"/>
156+ <field name="name">islr_router</field>
157+ <field name="kind">dummy</field>
158+ <field name="split_mode">XOR</field>
159+ </record>
160+
161+ <record id="act_islr_xml" model="workflow.activity">
162+ <field name="wkf_id" ref="account.wkf"/>
163+ <field name="name">islr_xml</field>
164+ <field name="kind">function</field>
165+ <field name="action">action_islr_xml()</field>
166+ </record>
167 #----------------------------------------------
168 # Transitions
169 #----------------------------------------------
170@@ -28,13 +40,29 @@
171 <!-- <field name="act_from" ref="account.act_withold_islr"/>-->
172 <!-- </record>-->
173 <!-- From Open to Withholdings-->
174- <record id="trans_open_wh_islr" model="workflow.transition">
175- <field name="act_from" ref="account.act_open"/>
176+
177+
178+ <record id="trans_wh_router_wh_islr" model="workflow.transition">
179+ <field name="act_from" ref="l10n_ve_withholding.act_wh_router"/>
180+ <field name="act_to" ref="act_islr_router"/>
181+ <field name="condition">True</field>
182+ <field name="signal"></field>
183+ </record>
184+
185+ <record id="trans_wh_router_xml" model="workflow.transition">
186+ <field name="act_from" ref="act_islr_router"/>
187+ <field name="act_to" ref="act_islr_xml"/>
188+ <field name="condition">check_wh_islr_xml()</field>
189+ <field name="signal"></field>
190+ </record>
191+
192+ <record id="trans_islr_router_wh_islr" model="workflow.transition">
193+ <field name="act_from" ref="act_islr_router"/>
194 <field name="act_to" ref="act_withold_islr"/>
195 <field name="condition">check_wh_islr_apply()</field>
196 <field name="signal"></field>
197- </record>
198-<!-- From Withholdings to paid-->
199+ </record>
200+ <!-- From Withholdings to paid-->
201
202 <record id="trans_withhold_paid" model="workflow.transition">
203 <field name="act_from" ref="act_withold_islr"/>
204
205=== modified file 'l10n_ve_withholding_iva/account_workflow.xml'
206--- l10n_ve_withholding_iva/account_workflow.xml 2011-10-30 04:26:37 +0000
207+++ l10n_ve_withholding_iva/account_workflow.xml 2011-10-31 09:06:24 +0000
208@@ -27,9 +27,9 @@
209 <!--<field name="act_from" ref="act_open"/>-->
210 <!-- <field name="act_from" ref="account.act_withold_vat"/>-->
211 <!-- </record>-->
212-<!-- From Open to Withholdings-->
213- <record id="trans_open_wh" model="workflow.transition">
214- <field name="act_from" ref="account.act_open"/>
215+<!-- From WH_ROUTER to Withholdings-->
216+ <record id="trans_wh_router_wh_vat" model="workflow.transition">
217+ <field name="act_from" ref="l10n_ve_withholding.act_wh_router"/>
218 <field name="act_to" ref="act_withold_vat"/>
219 <field name="condition">check_wh_apply()</field>
220 <field name="signal"></field>