Merge lp:~vauxoo/openerp-venezuela-localization/jose-withholding-iva into lp:~openerp-venezuela/openerp-venezuela-localization/6.0-trunk

Status: Rejected
Rejected by: Gabriela Quilarque
Proposed branch: lp:~vauxoo/openerp-venezuela-localization/jose-withholding-iva
Merge into: lp:~openerp-venezuela/openerp-venezuela-localization/6.0-trunk
Diff against target: 260 lines (+76/-46)
4 files modified
l10n_ve_withholding_islr/islr_xml_wh.py (+24/-10)
l10n_ve_withholding_islr/islr_xml_wh.xml (+6/-3)
l10n_ve_withholding_iva/generate_txt.py (+40/-25)
l10n_ve_withholding_iva/generate_txt_view.xml (+6/-8)
To merge this branch: bzr merge lp:~vauxoo/openerp-venezuela-localization/jose-withholding-iva
Reviewer Review Type Date Requested Status
Gabriela Quilarque Pending
Review via email: mp+80947@code.launchpad.net

Description of the change

Added name by defaul in the generate txt and xml added other notebook in the view xml for company_id of generate txt

To post a comment you must log in.
454. By OpenERP <openerp@jose-pc>

[IMP] Added new funtion and generate txt
uncommented field in the generate txt

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'l10n_ve_withholding_islr/islr_xml_wh.py'
2--- l10n_ve_withholding_islr/islr_xml_wh.py 2011-10-25 20:33:16 +0000
3+++ l10n_ve_withholding_islr/islr_xml_wh.py 2011-11-01 21:40:28 +0000
4@@ -57,6 +57,7 @@
5 return res
6
7 _columns = {
8+ 'name':fields.char('Description',128, required=True, select=True, help = "Description about statement of withholding income"),
9 'company_id': fields.many2one('res.company', 'Company', required=True, help="Company"),
10 'state': fields.selection([
11 ('draft','Draft'),
12@@ -68,19 +69,39 @@
13 'period_id':fields.many2one('account.period','Period',required=True, domain="[('fiscalyear_id','=',fiscalyear_id)]", help="Period when the accounts entries were done"),
14 'amount_total_ret':fields.function(_get_amount_total,method=True, digits=(16, 2), readonly=True, string='Withholding Income Amount Total', help="Amount Total of withholding"),
15 'amount_total_base':fields.function(_get_amount_total_base,method=True, digits=(16, 2), readonly=True, string='Without Tax Amount Total', help="Total without taxes"),
16- 'xml_ids':fields.one2many('islr.xml.wh.line','islr_xml_wh_doc','XML Document Lines', readonly=True ,domain="[('period_id','=',period_id), ('islr_xml_wh_doc','=',False)]",states={'draft':[('readonly',False)]}),
17+ 'xml_ids':fields.one2many('islr.xml.wh.line','islr_xml_wh_doc','XML Document Lines', readonly=True ,states={'draft':[('readonly',False)]}),
18 'user_id': fields.many2one('res.users', 'Salesman', readonly=True, states={'draft':[('readonly',False)]}),
19 }
20- _rec_rame = 'company_id'
21-
22 _defaults = {
23 'state': lambda *a: 'draft',
24 'company_id': lambda self, cr, uid, context: \
25 self.pool.get('res.users').browse(cr, uid, uid,
26 context=context).company_id.id,
27 'user_id': lambda s, cr, u, c: u,
28+
29+ 'fiscalyear_id': lambda self,cr,uid,conext:\
30+ self.pool.get('account.fiscalyear').browse(cr,uid,uid,context={}).id,
31+
32+ 'period_id': lambda self,cr,uid,context: self.period_return(cr,uid,context),
33+ 'name':lambda self,cr,uid,context : 'Withholding Income '+time.strftime('%m/%Y')
34 }
35
36+ def period_return(self,cr,uid,contex=None):
37+ period_obj = self.pool.get('account.period')
38+ fecha = time.strftime('%m/%Y')
39+ period_id = period_obj.search(cr,uid,[('code','=',fecha)])
40+ if period_id:
41+ return period_id[0]
42+ else:
43+ return False
44+
45+ def name_get(self, cr, uid, ids, context={}):
46+ if not len(ids):
47+ return []
48+
49+ res = [(r['id'], r['name']) for r in self.read(cr, uid, ids, ['name'], context)]
50+ return res
51+
52 def action_anular1(self, cr, uid, ids, context={}):
53 return self.write(cr, uid, ids, {'state':'draft'})
54
55@@ -191,7 +212,6 @@
56
57 islr_xml_wh_line()
58
59-
60 class account_invoice_line(osv.osv):
61 _inherit = "account.invoice.line"
62
63@@ -202,9 +222,3 @@
64 'wh_xml_id': lambda *a: 0,
65 }
66 account_invoice_line()
67-
68-
69-
70-
71-
72-
73
74=== modified file 'l10n_ve_withholding_islr/islr_xml_wh.xml'
75--- l10n_ve_withholding_islr/islr_xml_wh.xml 2011-10-25 20:33:16 +0000
76+++ l10n_ve_withholding_islr/islr_xml_wh.xml 2011-11-01 21:40:28 +0000
77@@ -57,6 +57,7 @@
78 <field name="type">tree</field>
79 <field name="arch" type="xml">
80 <tree string="Lines Withholding for XML" >
81+ <field name="name"/>
82 <field name="company_id"/>
83 <field name="fiscalyear_id"/>
84 <field name="period_id"/>
85@@ -70,7 +71,7 @@
86 <field name="type">form</field>
87 <field name="arch" type="xml">
88 <form string="Lines Withholding for XML">
89- <field name="company_id"/>
90+ <field name="name"/>
91 <newline/>
92 <group col="4" colspan="2">
93 <field name="fiscalyear_id" />
94@@ -99,7 +100,10 @@
95 <field name="amount_total_ret"/>
96 <field name="amount_total_base"/>
97 </group>
98- </page>
99+ </page>
100+ <page string="Other information">
101+ <field name="company_id" />
102+ </page>
103 </notebook>
104 </form>
105 </field>
106@@ -163,7 +167,6 @@
107 </data>
108 </openerp>
109
110-<!-- parent="l10n_ve_withholding.menu_wh_suppiler"-->
111
112
113
114
115=== modified file 'l10n_ve_withholding_iva/generate_txt.py'
116--- l10n_ve_withholding_iva/generate_txt.py 2011-10-25 20:33:16 +0000
117+++ l10n_ve_withholding_iva/generate_txt.py 2011-11-01 21:40:28 +0000
118@@ -38,27 +38,24 @@
119 class txt_iva(osv.osv):
120 _name = "txt.iva"
121
122- #~ def _get_amount_total(self,cr,uid,ids,name,args,context=None):
123- #~ res = {}
124- #~ for txt in self.browse(cr,uid,ids,context):
125- #~ res[txt.id]=0.0
126- #~ for txt_line in txt.txt_ids:
127- #~ res[txt.id] += txt_line.amount_withheld
128- #~
129- #~ return res
130+ def _get_amount_total(self,cr,uid,ids,name,args,context=None):
131+ res = {}
132+ for txt in self.browse(cr,uid,ids,context):
133+ res[txt.id]=0.0
134+ for txt_line in txt.txt_ids:
135+ res[txt.id] += txt_line.amount_withheld
136+ return res
137
138- #~ def _get_amount_total_base(self,cr,uid,ids,name,args,context=None):
139- #~ res = {}
140- #~ for txt in self.browse(cr,uid,ids,context):
141- #~ res[txt.id]= 0.0
142- #~ for txt_line in txt.txt_ids:
143- #~ print 'result: ',res[txt.id]
144- #~ print 'monto: ', txt_line.untaxed
145- #~ res[txt.id] += txt_line.untaxed
146- #~
147- #~ return res
148+ def _get_amount_total_base(self,cr,uid,ids,name,args,context=None):
149+ res = {}
150+ for txt in self.browse(cr,uid,ids,context):
151+ res[txt.id]= 0.0
152+ for txt_line in txt.txt_ids:
153+ res[txt.id] += txt_line.untaxed
154+ return res
155
156 _columns = {
157+ 'name':fields.char('Description',128, required=True, select=True, help = "Description about statement of withholding income"),
158 'company_id': fields.many2one('res.company', 'Company', required=True, readonly=True,states={'draft':[('readonly',False)]}),
159 'state': fields.selection([
160 ('draft','Draft'),
161@@ -72,18 +69,36 @@
162 'date_start': fields.date('Begin Date',required=True,states={'draft':[('readonly',False)]}, help="Begin date of period"),
163 'date_end': fields.date('End date', required=True,states={'draft':[('readonly',False)]}, help="End date of period"),
164 'type':fields.boolean('RetenciĆ³n Proveedores?',required=True,states={'draft':[('readonly',False)]}, help="Select the type of retention to make"),
165- 'txt_ids':fields.one2many('txt.iva.line','txt_id',domain="[('txt_id','=',False)]", readonly=True,states={'draft':[('readonly',False)]}, help='Txt field lines of ar required by SENIAT for VAT withholding'),
166- #~ 'amount_total_ret':fields.function(_get_amount_total,method=True, digits=(16, 2), readonly=True, string=' Total Monto de Retencion', help="Monto Total Retenido"),
167- #~ 'amount_total_base':fields.function(_get_amount_total_base,method=True, digits=(16, 2), readonly=True, string='Total Base Imponible', help="Total de la Base Imponible"),
168+ 'txt_ids':fields.one2many('txt.iva.line','txt_id', readonly=True,states={'draft':[('readonly',False)]}, help='Txt field lines of ar required by SENIAT for VAT withholding'),
169+ 'amount_total_ret':fields.function(_get_amount_total,method=True, digits=(16, 2), readonly=True, string=' Total Monto de Retencion', help="Monto Total Retenido"),
170+ 'amount_total_base':fields.function(_get_amount_total_base,method=True, digits=(16, 2), readonly=True, string='Total Base Imponible', help="Total de la Base Imponible"),
171 }
172- _rec_rame = 'company_id'
173 _defaults = {
174 'state': lambda *a: 'draft',
175 'company_id': lambda self, cr, uid, context: \
176 self.pool.get('res.users').browse(cr, uid, uid,
177 context=context).company_id.id,
178 'type': lambda *a:'True',
179- }
180+ 'fiscalyear_id': lambda self,cr,uid,conext:\
181+ self.pool.get('account.fiscalyear').browse(cr,uid,uid,context={}).id,
182+ 'period_id': lambda self,cr,uid,context: self.period_return(cr,uid,context),
183+ 'name':lambda self,cr,uid,context : 'Withholding Vat '+time.strftime('%m/%Y')
184+ }
185+
186+ def period_return(self,cr,uid,contex=None):
187+ period_obj = self.pool.get('account.period')
188+ fecha = time.strftime('%m/%Y')
189+ period_id = period_obj.search(cr,uid,[('code','=',fecha)])
190+ if period_id:
191+ return period_id[0]
192+ else:
193+ return False
194+
195+ def name_get(self, cr, uid, ids, context={}):
196+ if not len(ids):
197+ return []
198+ res = [(r['id'], r['name']) for r in self.read(cr, uid, ids, ['name'], context)]
199+ return res
200
201 def action_anular(self, cr, uid, ids, context={}):
202 return self.write(cr, uid, ids, {'state':'draft'})
203@@ -108,7 +123,7 @@
204
205 for voucher in voucher_obj.browse(cr,uid,voucher_ids):
206
207- for voucher_lines in voucher.retention_line:
208+ for voucher_lines in voucher.wh_lines:
209
210 if voucher_lines.invoice_id.state in ['open','paid']:
211 txt_iva_obj.create(cr,uid,
212@@ -213,7 +228,7 @@
213 document_type = self.get_type_document(cr,uid,txt_line)
214 document_number=self.get_document_number(cr,uid,ids,txt_line,'inv_number',context)
215 control_number = self.get_number(cr,uid,txt_line.invoice_id.nro_ctrl,'inv_ctrl',20)
216- document_affected= self.get_document_affected(cr,uid,txt_line,context)
217+ #~ document_affected= self.get_document_affected(cr,uid,txt_line,context)
218 voucher_number = self.get_number(cr,uid,txt_line.voucher_id.number,'vou_number',14)
219 amount_exempt,amount_untaxed = self.get_amount_exempt_document(cr,uid,txt_line)
220 alicuota = self.get_alicuota(cr,uid,txt_line)
221
222=== modified file 'l10n_ve_withholding_iva/generate_txt_view.xml'
223--- l10n_ve_withholding_iva/generate_txt_view.xml 2011-10-25 20:33:16 +0000
224+++ l10n_ve_withholding_iva/generate_txt_view.xml 2011-11-01 21:40:28 +0000
225@@ -29,7 +29,7 @@
226 <field name="arch" type="xml">
227 <form string="Withholding lines for TXT">
228 <group col="4" colspan="4">
229- <field name="company_id"/>
230+ <field name="name"/>
231 <field name="type"/>
232 </group>
233 <newline/>
234@@ -60,13 +60,15 @@
235 <button name="action_done" string="Make TXT" states="confirmed" type="object" icon="gtk-ok"/>
236 <button name="action_anular" string="Canlce" states="confirmed,done" type="object" icon="gtk-cancel"/>
237 </group>
238-<!--
239 <group col="2" colspan="2">
240 <field name="amount_total_ret"/>
241 <field name="amount_total_base"/>
242- </group>
243--->
244+ </group>
245 </page>
246+ <page string="Other information">
247+ <field name="company_id" />
248+ </page>
249+
250 </notebook>
251 </form>
252 </field>
253@@ -102,7 +104,3 @@
254 </data>
255 </openerp>
256
257-
258-
259-
260-