Merge lp:~vauxoo/openerp-venezuela-localization/ovl70-fr-rev-kty into lp:~vauxoo/openerp-venezuela-localization/ovl70-fr-rev-hbto
- ovl70-fr-rev-kty
- Merge into ovl70-fr-rev-hbto
Status: | Merged |
---|---|
Merged at revision: | 811 |
Proposed branch: | lp:~vauxoo/openerp-venezuela-localization/ovl70-fr-rev-kty |
Merge into: | lp:~vauxoo/openerp-venezuela-localization/ovl70-fr-rev-hbto |
Diff against target: |
593 lines (+72/-128) 20 files modified
l10n_ve_fiscal_requirements/model/invoice.py (+9/-16) l10n_ve_fiscal_requirements/test/fr_damaged.yml (+1/-3) l10n_ve_fiscal_requirements/test/fr_purchase_test.yml (+2/-2) l10n_ve_fiscal_requirements/test/fr_refund_note.yml (+5/-11) l10n_ve_fiscal_requirements/test/fr_sale_test.yml (+1/-3) l10n_ve_fiscal_requirements/test/fr_vat_test.yml (+20/-13) l10n_ve_fiscal_requirements/view/account_inv_refund_nctrl_view.xml (+0/-1) l10n_ve_fiscal_requirements/view/account_invoice_view.xml (+0/-3) l10n_ve_fiscal_requirements/view/account_tax_view.xml (+0/-1) l10n_ve_fiscal_requirements/view/l10n_ut_view.xml (+0/-3) l10n_ve_fiscal_requirements/view/partner_view.xml (+0/-1) l10n_ve_fiscal_requirements/wizard/account_invoice_debit.py (+15/-38) l10n_ve_fiscal_requirements/wizard/account_invoice_debit_view.xml (+0/-1) l10n_ve_fiscal_requirements/wizard/account_invoice_parent_view.xml (+0/-1) l10n_ve_fiscal_requirements/wizard/account_invoice_refund.py (+19/-26) l10n_ve_fiscal_requirements/wizard/search_info_partner_seniat.xml (+0/-1) l10n_ve_fiscal_requirements/wizard/update_info_partner.xml (+0/-1) l10n_ve_fiscal_requirements/wizard/wizard_invoice_nro_ctrl_view.xml (+0/-1) l10n_ve_fiscal_requirements/wizard/wizard_nro_ctrl_view.xml (+0/-1) l10n_ve_fiscal_requirements/wizard/wizard_url_seniat_view.xml (+0/-1) |
To merge this branch: | bzr merge lp:~vauxoo/openerp-venezuela-localization/ovl70-fr-rev-kty |
Related bugs: | |
Related blueprints: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
hbto [Vauxoo] http://www.vauxoo.com | Pending | ||
Review via email: mp+139019@code.launchpad.net |
Commit message
Description of the change
[INFO] finalizada revision de los test de fiscal requirements
- 807. By Katherine Zaoral (Vauxoo)
-
[DEL] borrando mensajes de impresion de prueba
- 808. By Katherine Zaoral (Vauxoo)
-
[MERGE] ovl70-fr-rev-hbto
- 809. By Katherine Zaoral (Vauxoo)
-
[MERGE] localization 7.0 @ revision 766
- 810. By Katherine Zaoral (Vauxoo)
-
[INFO] revision de las pruebas con los test yml
- 811. By Katherine Zaoral (Vauxoo)
-
[FIX] 'res.partner.
address' : Removed the record for being an deprecated model. Test was adapted to integrate the info of the addresses in the 'res.partner' records.
---- ES_es
[FIX] 'res.partner.address' : eliminado record por ser un modelo obsoleto, y adaptacion de la prueba para integrar la info de las direcciones en los records 'res.partner'. - 812. By Katherine Zaoral (Vauxoo)
-
[FIX] adaptacion de las vistas con openerp 7 (deprecated type)
- 813. By Katherine Zaoral (Vauxoo)
-
[FIX] campo 'tax_id' referenciado en test/fr_damaged.yml no existe, se referia a 'tax_code_id'
- 814. By Katherine Zaoral (Vauxoo)
-
[FIX] Adaptation for compatibility with OpenERP 7.0 wizard. Erased the line import wizard.
---- ES_es
[FIX] Adaptación para compatibilidad de los wizard con Openerp 7.0. Se borro la linea import wizard. - 815. By Katherine Zaoral (Vauxoo)
-
[FIX] misuse of context in browse orm call that generate an error in mids.move_id.id (because this call overwrite the context with only ['move_id'] - OMG a list ).
- 816. By Katherine Zaoral (Vauxoo)
-
[IMP] se quito el metodo obsoleto _get_period y se uso period.find()
- 817. By Katherine Zaoral (Vauxoo)
-
[FIX] error in the _refund_
cleanup_ lines() function (impossible delet a browse record type) - 818. By Katherine Zaoral (Vauxoo)
-
[FIX] yml: quitado referencias a registros que ya no existen de 'product' y redirigidos a otros que si.
[FIX] yml: se quitaron campos que ya no existen 'address_contact_ id' y 'address_ invoice_ id' - 819. By Katherine Zaoral (Vauxoo)
-
[MERGE] localization revno 770
- 820. By Katherine Zaoral (Vauxoo)
-
[FIX] eliminado metodo _refund_
cleanup_ lines() . sin razon de existir. Resulta que funciona perfectamente pero en 'wizard/ account. invoice. refund. py:linea 255' se utiliza para limpiar tax_lines, entonces produce error ya que los campos en el metodo estan especificados para invoice_lines y no para tax_lines y producia keyErrror. Dejando el metood que viene en el core no hay problema porque el revisa todos los campos propios del modelo y apartir de ahi hace su accion - 821. By Katherine Zaoral (Vauxoo)
-
[FIX] error al correr las pruebas porque read() devolvia una tupla en lugar de un browseable
- 822. By Katherine Zaoral (Vauxoo)
-
[FIX] record roto a 'product', enlazado a un record que si existe
- 823. By Katherine Zaoral (Vauxoo)
-
[FIX] cambio del mal uso de campo 'description' (no existe) por el campo 'name' del modelo 'account.inovice'.
- 824. By Katherine Zaoral (Vauxoo)
-
[MERGE] localization revno 771
- 825. By Katherine Zaoral (Vauxoo)
-
[FIX] solucionado error de indexacion en el test case 8.12 (IndexError: list index out of range)
- 826. By Katherine Zaoral (Vauxoo)
-
[FIX] eliminadas lineas relativas al campo 'sale_ids', no esta definido. este campo fue borrado de 'account_invoice' en fiscal requirements en la revion 499 de la localizacion
Preview Diff
1 | === modified file 'l10n_ve_fiscal_requirements/model/invoice.py' |
2 | --- l10n_ve_fiscal_requirements/model/invoice.py 2012-12-04 21:56:01 +0000 |
3 | +++ l10n_ve_fiscal_requirements/model/invoice.py 2013-01-11 18:35:30 +0000 |
4 | @@ -79,22 +79,6 @@ |
5 | _constraints = [ |
6 | (_unique_invoice_per_partner, _('The Document you have been entering for this Partner has already been recorded'),['Control Number (nro_ctrl)','Reference (reference)']), |
7 | ] |
8 | - |
9 | - def _refund_cleanup_lines(self, cr, uid, lines): |
10 | - """ |
11 | - Method created to clean invoice lines |
12 | - """ |
13 | - for line in lines: |
14 | - del line['id'] |
15 | - del line['invoice_id'] |
16 | - #TODO Verify one more elegant way to do this |
17 | - for field in ('company_id', 'partner_id', 'account_id', 'product_id', |
18 | - 'uos_id', 'account_analytic_id', 'tax_code_id', 'base_code_id', |
19 | - "concept_id","tax_id"): |
20 | - line[field] = line.get(field, False) and line[field][0] |
21 | - if 'invoice_line_tax_id' in line: |
22 | - line['invoice_line_tax_id'] = [(6,0, line.get('invoice_line_tax_id', [])) ] |
23 | - return map(lambda x: (0,0,x), lines) |
24 | |
25 | def copy(self, cr, uid, id, default={}, context=None): |
26 | if context is None: |
27 | @@ -108,4 +92,13 @@ |
28 | account_invoice() |
29 | |
30 | |
31 | +class account_invoice_tax(osv.osv): |
32 | + _inherit = 'account.invoice.tax' |
33 | + _columns = { |
34 | + 'tax_id': fields.many2one('account.tax', 'Tax', required=False, ondelete='set null', |
35 | + help="Tax relation to original tax, to be able to take off all data from invoices."), |
36 | + } |
37 | + |
38 | +account_invoice_tax() |
39 | + |
40 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
41 | |
42 | === modified file 'l10n_ve_fiscal_requirements/test/fr_damaged.yml' |
43 | --- l10n_ve_fiscal_requirements/test/fr_damaged.yml 2012-09-26 16:20:44 +0000 |
44 | +++ l10n_ve_fiscal_requirements/test/fr_damaged.yml 2013-01-11 18:35:30 +0000 |
45 | @@ -19,11 +19,9 @@ |
46 | company_id: base.main_company |
47 | currency_id: base.EUR |
48 | date_invoice: !eval time.strftime('%Y-%m-%d') |
49 | - address_contact_id: base.res_partner_address_3 |
50 | - address_invoice_id: base.res_partner_address_3 |
51 | account_id: account.a_recv |
52 | invoice_line: |
53 | - - product_id: product.product_product_pc2 |
54 | + - product_id: product.product_product_3 |
55 | quantity: 5 |
56 | uos_id: product.product_uom_unit |
57 | price_unit: 20 |
58 | |
59 | === modified file 'l10n_ve_fiscal_requirements/test/fr_purchase_test.yml' |
60 | --- l10n_ve_fiscal_requirements/test/fr_purchase_test.yml 2012-09-26 16:20:44 +0000 |
61 | +++ l10n_ve_fiscal_requirements/test/fr_purchase_test.yml 2013-01-11 18:35:30 +0000 |
62 | @@ -10,7 +10,7 @@ |
63 | date_invoice: !eval time.strftime('%Y-%m-%d') |
64 | account_id: account.a_recv |
65 | invoice_line: |
66 | - - product_id: product.product_product_pc1 |
67 | + - product_id: product.product_product_4 |
68 | quantity: 3 |
69 | uos_id: product.product_uom_unit |
70 | price_unit: 3 |
71 | @@ -18,7 +18,7 @@ |
72 | account_id: account.a_sale |
73 | invoice_line_tax_id: |
74 | - iva_purchase1 |
75 | - - product_id: product.product_product_pc2 |
76 | + - product_id: product.product_product_3 |
77 | quantity: 5 |
78 | uos_id: product.product_uom_unit |
79 | price_unit: 2 |
80 | |
81 | === modified file 'l10n_ve_fiscal_requirements/test/fr_refund_note.yml' |
82 | --- l10n_ve_fiscal_requirements/test/fr_refund_note.yml 2012-09-26 16:20:44 +0000 |
83 | +++ l10n_ve_fiscal_requirements/test/fr_refund_note.yml 2013-01-11 18:35:30 +0000 |
84 | @@ -8,11 +8,9 @@ |
85 | company_id: base.main_company |
86 | currency_id: base.EUR |
87 | date_invoice: !eval time.strftime('%Y-%m-%d') |
88 | - address_contact_id: base.res_partner_address_3 |
89 | - address_invoice_id: base.res_partner_address_3 |
90 | account_id: account.a_recv |
91 | invoice_line: |
92 | - - product_id: product.product_product_pc2 |
93 | + - product_id: product.product_product_3 |
94 | quantity: 5 |
95 | uos_id: product.product_uom_unit |
96 | price_unit: 20 |
97 | @@ -105,10 +103,10 @@ |
98 | for line in rf_brw.invoice_line: |
99 | for tax in line.invoice_line_tax_id: |
100 | tax1.append(tax.id) |
101 | - rf_brw = self.browse(cr, uid, ai_id[0]) |
102 | + rf_brw = ai_id and self.browse(cr, uid, ai_id[0]) |
103 | tax2 = [] |
104 | whc2 = [] |
105 | - for line in rf_brw.invoice_line: |
106 | + for line in rf_brw and rf_brw.invoice_line: |
107 | for tax in line.invoice_line_tax_id: |
108 | tax2.append(tax.id) |
109 | tax1 = set(tax1) |
110 | @@ -126,11 +124,9 @@ |
111 | company_id: base.main_company |
112 | currency_id: base.EUR |
113 | date_invoice: !eval time.strftime('%Y-%m-%d') |
114 | - address_contact_id: base.res_partner_address_3 |
115 | - address_invoice_id: base.res_partner_address_3 |
116 | account_id: account.a_recv |
117 | invoice_line: |
118 | - - product_id: product.product_product_pc2 |
119 | + - product_id: product.product_product_3 |
120 | quantity: 5 |
121 | uos_id: product.product_uom_unit |
122 | price_unit: 20 |
123 | @@ -232,11 +228,9 @@ |
124 | company_id: base.main_company |
125 | currency_id: base.EUR |
126 | date_invoice: !eval time.strftime('%Y-%m-%d') |
127 | - address_contact_id: base.res_partner_address_3 |
128 | - address_invoice_id: base.res_partner_address_3 |
129 | account_id: account.a_recv |
130 | invoice_line: |
131 | - - product_id: product.product_product_pc2 |
132 | + - product_id: product.product_product_4 |
133 | quantity: 5 |
134 | uos_id: product.product_uom_unit |
135 | price_unit: 20 |
136 | |
137 | === modified file 'l10n_ve_fiscal_requirements/test/fr_sale_test.yml' |
138 | --- l10n_ve_fiscal_requirements/test/fr_sale_test.yml 2012-09-26 16:20:44 +0000 |
139 | +++ l10n_ve_fiscal_requirements/test/fr_sale_test.yml 2013-01-11 18:35:30 +0000 |
140 | @@ -8,11 +8,9 @@ |
141 | company_id: base.main_company |
142 | currency_id: base.EUR |
143 | date_invoice: !eval time.strftime('%Y-%m-%d') |
144 | - address_contact_id: base.res_partner_address_3 |
145 | - address_invoice_id: base.res_partner_address_3 |
146 | account_id: account.a_recv |
147 | invoice_line: |
148 | - - product_id: product.product_product_pc2 |
149 | + - product_id: product.product_product_3 |
150 | quantity: 5 |
151 | uos_id: product.product_uom_unit |
152 | price_unit: 20 |
153 | |
154 | === modified file 'l10n_ve_fiscal_requirements/test/fr_vat_test.yml' |
155 | --- l10n_ve_fiscal_requirements/test/fr_vat_test.yml 2012-09-26 21:08:18 +0000 |
156 | +++ l10n_ve_fiscal_requirements/test/fr_vat_test.yml 2013-01-11 18:35:30 +0000 |
157 | @@ -1,15 +1,6 @@ |
158 | - |
159 | 5. Fiscal requirements Vat tests |
160 | - |
161 | - 5.1 Add address |
162 | -- |
163 | - !record {model: res.partner.address, id: test_fr_add01}: |
164 | - type: invoice |
165 | - street: Av Siempre Viva |
166 | - phone: "(555) 5555555" |
167 | - fax: "(555) 1111111" |
168 | - email: fakemail@example.com |
169 | -- |
170 | 5.2 I try to create a partner with wrong vat |
171 | - |
172 | !python {model: res.partner}: | |
173 | @@ -19,7 +10,11 @@ |
174 | 'supplier': True, |
175 | 'customer': True, |
176 | 'vat': 'VEV333', |
177 | - 'address':[(6, 0, [ref("test_fr_add01")])] |
178 | + 'type': 'invoice', |
179 | + 'street': 'Av Siempre Viva', |
180 | + 'phone': "(555) 5555555", |
181 | + 'fax': "(555) 1111111", |
182 | + 'email': 'fakemail@example.com', |
183 | } |
184 | part_id = False |
185 | try: |
186 | @@ -46,7 +41,11 @@ |
187 | 'supplier': True, |
188 | 'customer': True, |
189 | 'vat': 'VEJ112223330', |
190 | - 'address': [(6, 0, [ref("test_fr_add01")])], |
191 | + 'type': 'invoice', |
192 | + 'street': 'Av Siempre Viva', |
193 | + 'phone': "(555) 5555555", |
194 | + 'fax': "(555) 1111111", |
195 | + 'email': 'fakemail@example.com', |
196 | } |
197 | part_id = self.create(cr, uid, part) |
198 | assert part_id, 'Partner should be created' |
199 | @@ -60,7 +59,11 @@ |
200 | 'supplier': True, |
201 | 'customer': True, |
202 | 'vat': 'VEJ112223330', |
203 | - 'address': [(6, 0, [ref("test_fr_add01")])], |
204 | + 'type': 'invoice', |
205 | + 'street': 'Av Siempre Viva', |
206 | + 'phone': "(555) 5555555", |
207 | + 'fax': "(555) 1111111", |
208 | + 'email': 'fakemail@example.com', |
209 | } |
210 | try: |
211 | rollback = cr.rollback |
212 | @@ -86,7 +89,11 @@ |
213 | 'supplier': True, |
214 | 'customer': True, |
215 | 'vat': 'VEJ223334445', |
216 | - 'address': [(6, 0, [ref("test_fr_add01")])], |
217 | + 'type': 'invoice', |
218 | + 'street': 'Av Siempre Viva', |
219 | + 'phone': "(555) 5555555", |
220 | + 'fax': "(555) 1111111", |
221 | + 'email': 'fakemail@example.com', |
222 | } |
223 | try: |
224 | rollback = cr.rollback |
225 | |
226 | === modified file 'l10n_ve_fiscal_requirements/view/account_inv_refund_nctrl_view.xml' |
227 | --- l10n_ve_fiscal_requirements/view/account_inv_refund_nctrl_view.xml 2012-11-06 22:01:07 +0000 |
228 | +++ l10n_ve_fiscal_requirements/view/account_inv_refund_nctrl_view.xml 2013-01-11 18:35:30 +0000 |
229 | @@ -5,7 +5,6 @@ |
230 | <record id="view_account_inv_nctrl_refund" model="ir.ui.view"> |
231 | <field name="name">account.inv.nctrl.refund.form</field> |
232 | <field name="model">account.invoice.refund</field> |
233 | - <field name="type">form</field> |
234 | <field name="inherit_id" ref="account.view_account_invoice_refund"/> |
235 | <field name="arch" type="xml"> |
236 | <xpath expr="//field[@name='period']" position="after"> |
237 | |
238 | === modified file 'l10n_ve_fiscal_requirements/view/account_invoice_view.xml' |
239 | --- l10n_ve_fiscal_requirements/view/account_invoice_view.xml 2012-12-04 22:37:47 +0000 |
240 | +++ l10n_ve_fiscal_requirements/view/account_invoice_view.xml 2013-01-11 18:35:30 +0000 |
241 | @@ -10,7 +10,6 @@ |
242 | <record id="account_invoice_ext_view_form_loc_ve" model="ir.ui.view"> |
243 | <field name="name">invoice_extended.account.invoice.form.loc_ve</field> |
244 | <field name="model">account.invoice</field> |
245 | - <field name="type">form</field> |
246 | <field name="inherit_id" ref="account.invoice_form"/> |
247 | <field name="arch" type="xml"> |
248 | <xpath expr="//field[@name='date_invoice']" position="replace"> |
249 | @@ -91,7 +90,6 @@ |
250 | <record id="account_inv_ext_view_tree_crdr" model="ir.ui.view"> |
251 | <field name="name">invoice_extended.tree.crdr</field> |
252 | <field name="model">account.invoice</field> |
253 | - <field name="type">tree</field> |
254 | <field name="inherit_id" ref="account.invoice_tree"/> |
255 | <field name="arch" type="xml"> |
256 | <xpath expr="//field[@name='origin']" position="after"> |
257 | @@ -109,7 +107,6 @@ |
258 | <record id="account_invoice_ext_view_supp_form_loc_ve" model="ir.ui.view"> |
259 | <field name="name">invoice_extended.account.invoice.supplier.form.loc_ve</field> |
260 | <field name="model">account.invoice</field> |
261 | - <field name="type">form</field> |
262 | <field name="inherit_id" ref="account.invoice_supplier_form"/> |
263 | <field name="arch" type="xml"> |
264 | <xpath expr="//field[@name='date_invoice']" position="replace"> |
265 | |
266 | === modified file 'l10n_ve_fiscal_requirements/view/account_tax_view.xml' |
267 | --- l10n_ve_fiscal_requirements/view/account_tax_view.xml 2012-11-07 21:33:58 +0000 |
268 | +++ l10n_ve_fiscal_requirements/view/account_tax_view.xml 2013-01-11 18:35:30 +0000 |
269 | @@ -13,7 +13,6 @@ |
270 | <record id="account_tax_applicability_2" model="ir.ui.view"> |
271 | <field name="name">account.tax.applicability</field> |
272 | <field name="model">account.tax</field> |
273 | - <field name="type">form</field> |
274 | <field name="inherit_id" ref="account.view_tax_form"/> |
275 | <field name="arch" type="xml"> |
276 | <xpath expr="//field[@name='active']" position="after"> |
277 | |
278 | === modified file 'l10n_ve_fiscal_requirements/view/l10n_ut_view.xml' |
279 | --- l10n_ve_fiscal_requirements/view/l10n_ut_view.xml 2012-11-06 22:01:07 +0000 |
280 | +++ l10n_ve_fiscal_requirements/view/l10n_ut_view.xml 2013-01-11 18:35:30 +0000 |
281 | @@ -5,7 +5,6 @@ |
282 | <record id="view_l10n_ut_filter" model="ir.ui.view"> |
283 | <field name="name">l10n.ut.search</field> |
284 | <field name="model">l10n.ut</field> |
285 | - <field name="type">search</field> |
286 | <field name="arch" type="xml"> |
287 | <search string="Search Tax Unit" version="7.0"> |
288 | <group col="10" colspan="4"> |
289 | @@ -24,7 +23,6 @@ |
290 | <record model="ir.ui.view" id="view_l10n_ut_form"> |
291 | <field name="name">l10n.ut.form</field> |
292 | <field name="model">l10n.ut</field> |
293 | - <field name="type">form</field> |
294 | <field name="arch" type="xml"> |
295 | <form string="Tax Unit" version="7.0"> |
296 | <group col="6" colspan="4"> |
297 | @@ -39,7 +37,6 @@ |
298 | <record model="ir.ui.view" id="view_l10n_ut_tree"> |
299 | <field name="name">l10n.ut.tree</field> |
300 | <field name="model">l10n.ut</field> |
301 | - <field name="type">tree</field> |
302 | <field name="arch" type="xml"> |
303 | <tree string="Tax Unit per date" editable="top"> |
304 | <field name="name"/> |
305 | |
306 | === modified file 'l10n_ve_fiscal_requirements/view/partner_view.xml' |
307 | --- l10n_ve_fiscal_requirements/view/partner_view.xml 2012-12-09 23:00:04 +0000 |
308 | +++ l10n_ve_fiscal_requirements/view/partner_view.xml 2013-01-11 18:35:30 +0000 |
309 | @@ -5,7 +5,6 @@ |
310 | <record id="view_partner_form2" model="ir.ui.view"> |
311 | <field name="name">res.partner.vat.inherit2</field> |
312 | <field name="model">res.partner</field> |
313 | - <field name="type">form</field> |
314 | <field name="inherit_id" ref="base.view_partner_form"/> |
315 | <field name="arch" type="xml"> |
316 | |
317 | |
318 | === modified file 'l10n_ve_fiscal_requirements/wizard/account_invoice_debit.py' |
319 | --- l10n_ve_fiscal_requirements/wizard/account_invoice_debit.py 2012-12-04 19:17:53 +0000 |
320 | +++ l10n_ve_fiscal_requirements/wizard/account_invoice_debit.py 2013-01-11 18:35:30 +0000 |
321 | @@ -81,19 +81,6 @@ |
322 | res['fields'][field]['selection'] = journal_select |
323 | return res |
324 | |
325 | - def _get_period(self, cr, uid, context=None): |
326 | - """ |
327 | - Return default account period value |
328 | - """ |
329 | - if context is None: |
330 | - context = {} |
331 | - account_period_obj = self.pool.get('account.period') |
332 | - ids = account_period_obj.find(cr, uid, context=context) |
333 | - period_id = False |
334 | - if ids: |
335 | - period_id = ids[0] |
336 | - return period_id |
337 | - |
338 | def _get_orig(self, cr, uid, inv, ref, context=None): |
339 | """ |
340 | Return default origin value |
341 | @@ -130,45 +117,39 @@ |
342 | date = False |
343 | period = False |
344 | description = False |
345 | - company = res_users_obj.browse(cr, uid, uid, context=context).company_id |
346 | + |
347 | journal_id = form.journal_id and form.journal_id.id or False |
348 | inv = inv_obj.browse(cr, uid, context.get('active_ids')[0], context=context) |
349 | + #~ TODOK: no seria mejor ids=context.get(active_id) |
350 | + |
351 | + company_id = inv.company_id.id |
352 | + context.update({'company_id':company_id}) |
353 | + |
354 | if inv.state in ['draft', 'proforma2', 'cancel']: |
355 | raise osv.except_osv(_('Error !'), _('Can not create a debit note from draft/proforma/cancel invoice.')) |
356 | if inv.reconciled in ('cancel', 'modify'): |
357 | raise osv.except_osv(_('Error !'), _('Can not create a debit note from invoice which is already reconciled, invoice should be unreconciled first. You can only Refund or Debit this invoice')) |
358 | if inv.type not in ['in_invoice', 'out_invoice']: |
359 | raise osv.except_osv(_('Error !'), _('Can not make a debit note on a refund invoice.')) |
360 | + |
361 | + #Check for the form fields |
362 | + |
363 | if form.period: |
364 | period = form.period.id |
365 | else: |
366 | #Take period from the current date |
367 | - #period = inv.period_id and inv.period_id.id or False |
368 | - period = self._get_period(cr, uid, context) |
369 | + period = self.pool.get('account.period').find(cr, uid, context=context) |
370 | + period = period and period[0] or False |
371 | + if not period: |
372 | + raise osv.except_osv(_('No Pediod Defined'), \ |
373 | + _('You have been left empty the period field that automatically fill with the current period. However there is not period defined for the current company. Please check in Accounting/Configuration/Periods')) |
374 | + self.write(cr, uid, ids, {'period': period }, context=context) |
375 | |
376 | if not journal_id: |
377 | journal_id = inv.journal_id.id |
378 | |
379 | if form.date: |
380 | date = form.date |
381 | - if not form.period.id: |
382 | - cr.execute("select name from ir_model_fields \ |
383 | - where model = 'account.period' \ |
384 | - and name = 'company_id'") |
385 | - result_query = cr.fetchone() |
386 | - if result_query: |
387 | - #in multi company mode |
388 | - cr.execute("""select p.id from account_fiscalyear y, account_period p where y.id=p.fiscalyear_id \ |
389 | - and date(%s) between p.date_start AND p.date_stop and y.company_id = %s limit 1""", (date, company.id,)) |
390 | - else: |
391 | - #in mono company mode |
392 | - cr.execute("""SELECT id |
393 | - from account_period where date(%s) |
394 | - between date_start AND date_stop \ |
395 | - limit 1 """, (date,)) |
396 | - res = cr.fetchone() |
397 | - if res: |
398 | - period = res[0] |
399 | else: |
400 | #Take current date |
401 | #date = inv.date_invoice |
402 | @@ -178,10 +159,6 @@ |
403 | else: |
404 | description = inv.name |
405 | |
406 | - if not period: |
407 | - raise osv.except_osv(_('Data Insufficient !'), \ |
408 | - _('No Period found on Invoice!')) |
409 | - |
410 | #we get original data of invoice to create a new invoice that is the copy of the original |
411 | invoice = inv_obj.read(cr, uid, [inv.id], |
412 | ['name', 'type', 'number', 'reference', |
413 | |
414 | === modified file 'l10n_ve_fiscal_requirements/wizard/account_invoice_debit_view.xml' |
415 | --- l10n_ve_fiscal_requirements/wizard/account_invoice_debit_view.xml 2012-11-06 22:01:07 +0000 |
416 | +++ l10n_ve_fiscal_requirements/wizard/account_invoice_debit_view.xml 2013-01-11 18:35:30 +0000 |
417 | @@ -5,7 +5,6 @@ |
418 | <record id="view_account_invoice_debit" model="ir.ui.view"> |
419 | <field name="name">account.invoice.debit.form</field> |
420 | <field name="model">account.invoice.debit</field> |
421 | - <field name="type">form</field> |
422 | <field name="arch" type="xml"> |
423 | <form string="Debit Note" version="7.0"> |
424 | <separator string="Debit Note Options" colspan="4"/> |
425 | |
426 | === modified file 'l10n_ve_fiscal_requirements/wizard/account_invoice_parent_view.xml' |
427 | --- l10n_ve_fiscal_requirements/wizard/account_invoice_parent_view.xml 2011-11-10 15:21:35 +0000 |
428 | +++ l10n_ve_fiscal_requirements/wizard/account_invoice_parent_view.xml 2013-01-11 18:35:30 +0000 |
429 | @@ -5,7 +5,6 @@ |
430 | <record id="view_account_invoice_parent" model="ir.ui.view"> |
431 | <field name="name">account.invoice.parent.form</field> |
432 | <field name="model">account.invoice.parent</field> |
433 | - <field name="type">form</field> |
434 | <field name="arch" type="xml"> |
435 | <form string="Debit Note"> |
436 | <separator string="Debit Note Options" colspan="4"/> |
437 | |
438 | === modified file 'l10n_ve_fiscal_requirements/wizard/account_invoice_refund.py' |
439 | --- l10n_ve_fiscal_requirements/wizard/account_invoice_refund.py 2012-11-07 15:19:17 +0000 |
440 | +++ l10n_ve_fiscal_requirements/wizard/account_invoice_refund.py 2013-01-11 18:35:30 +0000 |
441 | @@ -79,21 +79,6 @@ |
442 | res['fields'][field]['selection'] = journal_select |
443 | return res |
444 | |
445 | - def _get_period(self, cr, uid, context={}): |
446 | - """ |
447 | - Return default account period value |
448 | - """ |
449 | - period_id= False |
450 | - if context.get('active_id',False): |
451 | - invo_obj = self.pool.get('account.invoice') |
452 | - invo_brw = invo_obj.browse(cr,uid,context.get('active_id'),{}) |
453 | - period_id = invo_brw and invo_brw.period_id and invo_brw.period_id.id |
454 | - return period_id |
455 | - |
456 | - |
457 | - |
458 | - return period_id |
459 | - |
460 | def _get_orig(self, cr, uid, inv, ref, context={}): |
461 | """ |
462 | Return default origin value |
463 | @@ -165,8 +150,15 @@ |
464 | raise osv.except_osv(_('Error !'), _('Can not %s draft/proforma/cancel invoice.') % (mode)) |
465 | if inv.reconciled and mode in ('cancel', 'modify'): |
466 | raise osv.except_osv(_('Error !'), _('Can not %s invoice which is already reconciled, invoice should be unreconciled first. You can only Refund this invoice') % (mode)) |
467 | - #Take period from the current date |
468 | - period = form.get('period') and form.get('period')[0] or self._get_period(cr, uid, context) |
469 | + period = form.get('period') and form.get('period')[0] or False |
470 | + if not period: |
471 | + #Take period from the current date |
472 | + period = self.pool.get('account.period').find(cr, uid, context=context) |
473 | + period = period and period[0] or False |
474 | + if not period: |
475 | + raise osv.except_osv(_('No Pediod Defined'), \ |
476 | + _('You have been left empty the period field that automatically fill with the current period. However there is not period defined for the current company. Please check in Accounting/Configuration/Periods')) |
477 | + self.write(cr, uid, ids, {'period': period }, context=context) |
478 | |
479 | if not journal_brw: |
480 | journal_id = inv.journal_id.id |
481 | @@ -253,9 +245,10 @@ |
482 | 'journal_id', 'period_id'], context=context) |
483 | invoice = invoice[0] |
484 | del invoice['id'] |
485 | - invoice_lines = inv_line_obj.read(cr, uid, invoice['invoice_line'], context=context) |
486 | + invoice_lines = inv_line_obj.browse(cr, uid, invoice['invoice_line'], context=context) |
487 | + |
488 | invoice_lines = inv_obj._refund_cleanup_lines(cr, uid, invoice_lines) |
489 | - tax_lines = inv_tax_obj.read(cr, uid, invoice['tax_line'], context=context) |
490 | + tax_lines = inv_tax_obj.browse(cr, uid, invoice['tax_line'], context=context) |
491 | tax_lines = inv_obj._refund_cleanup_lines(cr, uid, tax_lines) |
492 | #Add origin value |
493 | orig = self._get_orig(cr, uid, inv, invoice['reference'], context) |
494 | @@ -283,12 +276,12 @@ |
495 | |
496 | new_inv_brw = inv_obj.browse(cr,uid,created_inv[1],context=context) |
497 | inv_obj.write(cr,uid,created_inv[0],{'name':wzd_brw.description,'origin':new_inv_brw.origin},context=context) |
498 | - inv_obj.write(cr,uid,created_inv[1],{'origin':inv.origin,'description':''},context=context) |
499 | + inv_obj.write(cr,uid,created_inv[1],{'origin':inv.origin,'name':wzd_brw.description},context=context) |
500 | if inv.type in ('out_invoice', 'out_refund'): |
501 | xml_id = 'action_invoice_tree3' |
502 | - if hasattr(inv, 'sale_ids'): |
503 | - for i in inv.sale_ids: |
504 | - cr.execute('insert into sale_order_invoice_rel (order_id,invoice_id) values (%s,%s)', (i.id, refund_id[0])) |
505 | + #~ if hasattr(inv, 'sale_ids'): |
506 | + #~ for i in inv.sale_ids: |
507 | + #~ cr.execute('insert into sale_order_invoice_rel (order_id,invoice_id) values (%s,%s)', (i.id, refund_id[0])) |
508 | else: |
509 | xml_id = 'action_invoice_tree4' |
510 | result = mod_obj.get_object_reference(cr, uid, 'account', xml_id) |
511 | @@ -300,11 +293,11 @@ |
512 | |
513 | if wzd_brw.filter_refund == 'cancel': |
514 | orig = self._get_orig(cr, uid, inv, inv.reference, context) |
515 | - inv_obj.write(cr,uid,created_inv[0],{'origin':orig,'description':wzd_brw.description},context=context) |
516 | + inv_obj.write(cr,uid,created_inv[0],{'origin':orig,'name':wzd_brw.description},context=context) |
517 | |
518 | if wzd_brw.filter_refund == 'refund': |
519 | orig = self._get_orig(cr, uid, inv, inv.reference, context) |
520 | - inv_obj.write(cr,uid,created_inv[0],{'origin':inv.origin,'description':wzd_brw.description},context=context) |
521 | + inv_obj.write(cr,uid,created_inv[0],{'origin':inv.origin,'name':wzd_brw.description},context=context) |
522 | return result |
523 | |
524 | def validate_total_payment_inv(self, cr, uid, ids, context=None): |
525 | @@ -354,7 +347,7 @@ |
526 | if moveline.reconcile_partial_id: |
527 | rec += [moveline.reconcile_partial_id.id] |
528 | movelines = moveline_obj.search(cr, uid, [('|'),('reconcile_id','in',rec),('reconcile_partial_id','in',rec)],context=context) |
529 | - for mids in moveline_obj.browse(cr, uid, movelines, ['move_id']): |
530 | + for mids in moveline_obj.browse(cr, uid, movelines, context=context): |
531 | mid +=[mids.move_id.id] |
532 | voucherids = voucher_pool.search(cr, uid,[('move_id','in',mid)]) |
533 | if voucherids: |
534 | |
535 | === modified file 'l10n_ve_fiscal_requirements/wizard/search_info_partner_seniat.xml' |
536 | --- l10n_ve_fiscal_requirements/wizard/search_info_partner_seniat.xml 2012-09-26 21:07:02 +0000 |
537 | +++ l10n_ve_fiscal_requirements/wizard/search_info_partner_seniat.xml 2013-01-11 18:35:30 +0000 |
538 | @@ -4,7 +4,6 @@ |
539 | <record model="ir.ui.view" id="view_vat_search"> |
540 | <field name="name">search.info.partner.seniat.form</field> |
541 | <field name="model">search.info.partner.seniat</field> |
542 | - <field name="type">form</field> |
543 | <field name="arch" type="xml"> |
544 | <form string="Wizard to search partner on SENIAT"> |
545 | <group colspan="4"> |
546 | |
547 | === modified file 'l10n_ve_fiscal_requirements/wizard/update_info_partner.xml' |
548 | --- l10n_ve_fiscal_requirements/wizard/update_info_partner.xml 2011-10-25 20:33:16 +0000 |
549 | +++ l10n_ve_fiscal_requirements/wizard/update_info_partner.xml 2013-01-11 18:35:30 +0000 |
550 | @@ -7,7 +7,6 @@ |
551 | <record id="view_wizard_update_info_partner" model="ir.ui.view"> |
552 | <field name="name">view.update.info.partner</field> |
553 | <field name="model">update.info.partner</field> |
554 | - <field name="type">form</field> |
555 | <field name="arch" type="xml"> |
556 | <form string=""> |
557 | <separator string="Are you sure you want to do this?" colspan="4"/> |
558 | |
559 | === modified file 'l10n_ve_fiscal_requirements/wizard/wizard_invoice_nro_ctrl_view.xml' |
560 | --- l10n_ve_fiscal_requirements/wizard/wizard_invoice_nro_ctrl_view.xml 2012-04-11 21:48:15 +0000 |
561 | +++ l10n_ve_fiscal_requirements/wizard/wizard_invoice_nro_ctrl_view.xml 2013-01-11 18:35:30 +0000 |
562 | @@ -4,7 +4,6 @@ |
563 | <record id="view_wizard_invoice_nro_ctrl" model="ir.ui.view"> |
564 | <field name="name">view.wizard.invoice.nro.ctrl</field> |
565 | <field name="model">wizard.invoice.nro.ctrl</field> |
566 | - <field name="type">form</field> |
567 | <field name="arch" type="xml"> |
568 | <form string="Create an invoice to justify the damaged one"> |
569 | <group colspan="8" col="8"> |
570 | |
571 | === modified file 'l10n_ve_fiscal_requirements/wizard/wizard_nro_ctrl_view.xml' |
572 | --- l10n_ve_fiscal_requirements/wizard/wizard_nro_ctrl_view.xml 2012-02-09 21:33:03 +0000 |
573 | +++ l10n_ve_fiscal_requirements/wizard/wizard_nro_ctrl_view.xml 2013-01-11 18:35:30 +0000 |
574 | @@ -4,7 +4,6 @@ |
575 | <record model="ir.ui.view" id="wizard_nro_ctrl_form"> |
576 | <field name="name">wizard.nro.ctrl.form</field> |
577 | <field name="model">wiz.nroctrl</field> |
578 | - <field name="type">form</field> |
579 | <field name="arch" type="xml"> |
580 | <form string="Changing the Control Number"> |
581 | <field name="name" /> |
582 | |
583 | === modified file 'l10n_ve_fiscal_requirements/wizard/wizard_url_seniat_view.xml' |
584 | --- l10n_ve_fiscal_requirements/wizard/wizard_url_seniat_view.xml 2012-07-16 18:55:40 +0000 |
585 | +++ l10n_ve_fiscal_requirements/wizard/wizard_url_seniat_view.xml 2013-01-11 18:35:30 +0000 |
586 | @@ -4,7 +4,6 @@ |
587 | <record id="view_wizard_url_seniat" model="ir.ui.view"> |
588 | <field name="name">view.wizard.seniat.url</field> |
589 | <field name="model">wizard.seniat.url</field> |
590 | - <field name="type">form</field> |
591 | <field name="arch" type="xml"> |
592 | <form string="Update Url From Seniat"> |
593 | <separator string="URL Seniat for Partner Information" colspan="4"/> |