Merge lp:~vauxoo/openerp-venezuela-localization/israel_fiscal-req-decoupling into lp:~openerp-venezuela/openerp-venezuela-localization/6.0-trunk

Proposed by Israel Fermin Montilla
Status: Merged
Merged at revision: 401
Proposed branch: lp:~vauxoo/openerp-venezuela-localization/israel_fiscal-req-decoupling
Merge into: lp:~openerp-venezuela/openerp-venezuela-localization/6.0-trunk
Diff against target: 354 lines (+28/-177)
10 files modified
l10n_ve_fiscal_requirements/README (+2/-0)
l10n_ve_fiscal_requirements/__init__.py (+0/-2)
l10n_ve_fiscal_requirements/__openerp__.py (+5/-3)
l10n_ve_fiscal_requirements/purchase.py (+0/-43)
l10n_ve_fiscal_requirements/stock.py (+0/-36)
l10n_ve_fiscal_requirements/view/account_invoice_view.xml (+0/-19)
l10n_ve_fiscal_requirements/view/stock_view.xml (+0/-45)
l10n_ve_fiscal_requirements/wizard/wizard_invoice_nro_ctrl.py (+7/-3)
l10n_ve_fiscal_requirements/wizard/wizard_invoice_nro_ctrl_view.xml (+6/-14)
l10n_ve_fiscal_requirements/wizard/wizard_nro_ctrl_view.xml (+8/-12)
To merge this branch: bzr merge lp:~vauxoo/openerp-venezuela-localization/israel_fiscal-req-decoupling
Reviewer Review Type Date Requested Status
Nhomar - Vauxoo Pending
Review via email: mp+78027@code.launchpad.net

Description of the change

Decoupled from Purchase and Stock (local backup of the old files), refactored the view to take the damaged paper wizard out of the model on a menu item

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=== added file 'l10n_ve_fiscal_requirements/README'
2--- l10n_ve_fiscal_requirements/README 1970-01-01 00:00:00 +0000
3+++ l10n_ve_fiscal_requirements/README 2011-10-04 02:33:24 +0000
4@@ -0,0 +1,2 @@
5+1.- Eliminated the dependency on purchase, files involved: purchase.py, this file has a method that returns the partners invoicing address.
6+2.- Eliminated the dependency with stock, files involved: stock_view.xml. This overrides the stock.picking view to show a control number (nro_ctrl) atribute and stock.py that adds that attribute on the model
7
8=== modified file 'l10n_ve_fiscal_requirements/__init__.py'
9--- l10n_ve_fiscal_requirements/__init__.py 2011-10-03 20:29:07 +0000
10+++ l10n_ve_fiscal_requirements/__init__.py 2011-10-04 02:33:24 +0000
11@@ -18,8 +18,6 @@
12 # along with this program. If not, see <http://www.gnu.org/licenses/>.
13 #
14 ##############################################################################
15-import purchase
16-import stock
17 import invoice
18 import partner
19 import res_company
20
21=== modified file 'l10n_ve_fiscal_requirements/__openerp__.py'
22--- l10n_ve_fiscal_requirements/__openerp__.py 2011-10-03 21:13:35 +0000
23+++ l10n_ve_fiscal_requirements/__openerp__.py 2011-10-04 02:33:24 +0000
24@@ -53,15 +53,17 @@
25 - Integrated the l10n_ve_nro_ctrl module functionality on this one
26 - Since the concept_id field is added by the l10n_ve_islr_withholding, an
27 error es rised if it's not installed and it is necesary to withhold
28- - If you need to withhold ISLR, you must install the module mentioned abofe
29+ - If you need to withhold ISLR, you must install the module mentioned above
30+ - Eliminated the dependencies with stock and purchase modules, migrated that functionalities to
31+ other modules
32
33 """,
34 'init_xml': [
35 'data/l10n_ut_data.xml',
36 ],
37- "depends" : ["base_vat", "purchase", "stock", "account", "account_accountant"],
38+ "depends" : ["base_vat", "account", "account_accountant"],
39 'update_xml': [
40- 'view/stock_view.xml',
41+ 'security/ir.model.access.csv',
42 'view/account_invoice_view.xml',
43 'view/res_company_view.xml',
44 'view/l10n_ut_view.xml',
45
46=== removed file 'l10n_ve_fiscal_requirements/purchase.py'
47--- l10n_ve_fiscal_requirements/purchase.py 2011-05-11 16:42:07 +0000
48+++ l10n_ve_fiscal_requirements/purchase.py 1970-01-01 00:00:00 +0000
49@@ -1,43 +0,0 @@
50-# -*- coding: utf-8 -*-
51-##############################################################################
52-#
53-#
54-#
55-#
56-# This program is free software: you can redistribute it and/or modify
57-# it under the terms of the GNU Affero General Public License as
58-# published by the Free Software Foundation, either version 3 of the
59-# License, or (at your option) any later version.
60-#
61-# This program is distributed in the hope that it will be useful,
62-# but WITHOUT ANY WARRANTY; without even the implied warranty of
63-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
64-# GNU Affero General Public License for more details.
65-#
66-# You should have received a copy of the GNU Affero General Public License
67-# along with this program. If not, see <http://www.gnu.org/licenses/>.
68-#
69-##############################################################################
70-
71-from osv import fields, osv
72-
73-
74-class purchase_order(osv.osv):
75- _inherit='purchase.order'
76-
77- '''
78- Return address invoice by default
79- '''
80- def onchange_partner_id(self, cr, uid, ids, part):
81- if not part:
82- return {'value':{'partner_address_id': False, 'fiscal_position': False}}
83- addr = self.pool.get('res.partner').address_get(cr, uid, [part], ['invoice'])
84- part = self.pool.get('res.partner').browse(cr, uid, part)
85- pricelist = part.property_product_pricelist_purchase.id
86- fiscal_position = part.property_account_position and part.property_account_position.id or False
87- return {'value':{'partner_address_id': addr['invoice'], 'pricelist_id': pricelist, 'fiscal_position': fiscal_position}}
88-
89-purchase_order()
90-
91-
92-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
93
94=== removed file 'l10n_ve_fiscal_requirements/stock.py'
95--- l10n_ve_fiscal_requirements/stock.py 2011-05-11 16:42:07 +0000
96+++ l10n_ve_fiscal_requirements/stock.py 1970-01-01 00:00:00 +0000
97@@ -1,36 +0,0 @@
98-# -*- coding: utf-8 -*-
99-##############################################################################
100-#
101-#
102-#
103-#
104-# This program is free software: you can redistribute it and/or modify
105-# it under the terms of the GNU Affero General Public License as
106-# published by the Free Software Foundation, either version 3 of the
107-# License, or (at your option) any later version.
108-#
109-# This program is distributed in the hope that it will be useful,
110-# but WITHOUT ANY WARRANTY; without even the implied warranty of
111-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
112-# GNU Affero General Public License for more details.
113-#
114-# You should have received a copy of the GNU Affero General Public License
115-# along with this program. If not, see <http://www.gnu.org/licenses/>.
116-#
117-##############################################################################
118-
119-from osv import fields, osv
120-
121-
122-class stock_picking(osv.osv):
123- _inherit = 'stock.picking'
124- _columns = {
125- 'nro_ctrl': fields.char('Invoice ref.', size=32, readonly=True, states={'draft':[('readonly',False)]}, help="Invoice reference"),
126- }
127-
128-
129-
130-stock_picking()
131-
132-
133-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
134
135=== modified file 'l10n_ve_fiscal_requirements/view/account_invoice_view.xml'
136--- l10n_ve_fiscal_requirements/view/account_invoice_view.xml 2011-10-03 21:26:50 +0000
137+++ l10n_ve_fiscal_requirements/view/account_invoice_view.xml 2011-10-04 02:33:24 +0000
138@@ -1,15 +1,11 @@
139 <?xml version="1.0" encoding="utf-8"?>
140 <openerp>
141 <data>
142-
143-
144-
145 <!--
146 =====================================================
147 Invoices Extension
148 =====================================================
149 -->
150-
151 <record id="account_invoice_ext_view_form_loc_ve" model="ir.ui.view">
152 <field name="name">invoice_extended.account.invoice.form.loc_ve</field>
153 <field name="model">account.invoice</field>
154@@ -21,9 +17,6 @@
155 </xpath>
156 </field>
157 </record>
158-
159-
160-
161 <record id="account_invoice_ext_view_supp_form_loc_ve" model="ir.ui.view">
162 <field name="name">invoice_extended.account.invoice.supplier.form.loc_ve</field>
163 <field name="model">account.invoice</field>
164@@ -35,8 +28,6 @@
165 </xpath>
166 </field>
167 </record>
168-
169-
170 <record id="account_invoice_nro_control_supplier_form" model="ir.ui.view">
171 <field name="name">account.invoice.nro.control.supplier.form</field>
172 <field name="model">account.invoice</field>
173@@ -48,8 +39,6 @@
174 </xpath>
175 </field>
176 </record>
177-
178-
179 <record id="account_invoice_nro_control_customer_form" model="ir.ui.view">
180 <field name="name">account.invoice.nro.control.customer.form</field>
181 <field name="model">account.invoice</field>
182@@ -61,8 +50,6 @@
183 </xpath>
184 </field>
185 </record>
186-
187-
188 <record id="account_invoice_ext_view_tree_loc_ve2" model="ir.ui.view">
189 <field name="name">invoice_extended.account.invoice.tree.loc_ve2</field>
190 <field name="model">account.invoice</field>
191@@ -74,15 +61,11 @@
192 </xpath>
193 </field>
194 </record>
195-
196-
197 <!--
198 =====================================================
199 Filter invoice address
200 =====================================================
201 -->
202-
203-
204 <record id="account_invoice_addr_form_loc_ve" model="ir.ui.view">
205 <field name="name">invoice.address.account.invoice.form.loc_ve</field>
206 <field name="model">account.invoice</field>
207@@ -94,8 +77,6 @@
208 </xpath>
209 </field>
210 </record>
211-
212-
213 <record id="account_invoice_addr_supp_form_loc_ve" model="ir.ui.view">
214 <field name="name">account.invoice.address.supplier.form.loc_ve</field>
215 <field name="model">account.invoice</field>
216
217=== removed file 'l10n_ve_fiscal_requirements/view/stock_view.xml'
218--- l10n_ve_fiscal_requirements/view/stock_view.xml 2011-09-30 15:48:47 +0000
219+++ l10n_ve_fiscal_requirements/view/stock_view.xml 1970-01-01 00:00:00 +0000
220@@ -1,45 +0,0 @@
221-<?xml version="1.0" encoding="utf-8"?>
222-<openerp>
223- <data>
224- <record id="stock_picking_form_loc_ve" model="ir.ui.view">
225- <field name="name">stock.picking.form.loc_ve</field>
226- <field name="model">stock.picking</field>
227- <field name="type">form</field>
228- <field name="inherit_id" ref="stock.view_picking_form"/>
229- <field name="arch" type="xml">
230- <xpath expr="/form/group/group/field[@name='min_date']" position="after">
231- <field name="nro_ctrl" />
232- </xpath>
233- </field>
234- </record>
235-
236-
237- <record id="stock_picking_out_form_loc_ve" model="ir.ui.view">
238- <field name="name">stock.picking.out.form.loc_ve</field>
239- <field name="model">stock.picking</field>
240- <field name="type">form</field>
241- <field name="inherit_id" ref="stock.view_picking_out_form"/>
242- <field name="arch" type="xml">
243- <xpath expr="/form/group/group/field[@name='origin']" position="after">
244- <field name="nro_ctrl" />
245- </xpath>
246- </field>
247- </record>
248-
249-
250-
251- <record id="stock_picking_in_form_loc_ve" model="ir.ui.view">
252- <field name="name">stock.picking.in.form.loc_ve</field>
253- <field name="model">stock.picking</field>
254- <field name="type">form</field>
255- <field name="inherit_id" ref="stock.view_picking_in_form"/>
256- <field name="arch" type="xml">
257- <xpath expr="/form/group/group/field[@name='backorder_id']" position="after">
258- <field name="nro_ctrl" />
259- </xpath>
260- </field>
261- </record>
262-
263-
264- </data>
265-</openerp>
266
267=== modified file 'l10n_ve_fiscal_requirements/wizard/wizard_invoice_nro_ctrl.py'
268--- l10n_ve_fiscal_requirements/wizard/wizard_invoice_nro_ctrl.py 2011-09-30 18:03:47 +0000
269+++ l10n_ve_fiscal_requirements/wizard/wizard_invoice_nro_ctrl.py 2011-10-04 02:33:24 +0000
270@@ -105,9 +105,13 @@
271 wizard_brw = self.browse(cr, uid, ids, context=None)
272 wizard_deli_obj = self.pool.get('wz.picking.delivery.note')
273 inv_id = context['active_id']
274- invoice_obj = self.pool.get('account.invoice')
275- inv_brw = invoice_obj.browse(cr,uid,inv_id,context)
276-
277+ if context['menu']:
278+ invoice_obj = self.pool.get('account.invoice')
279+ inv_brw = invoice_obj.browse(cr, uid, invoice_obj.search(cr, uid, [], limit=1), context)
280+ if inv_brw == []:
281+ raise osv.except_osv(_("ERROR !"), _("You must have created at least one invoice to declare it as damaged"))
282+ inv_id = inv_brw[0].id
283+ inv_brw = inv_brw[0]
284 for wizard in wizard_brw:
285 if not wizard.sure:
286 raise osv.except_osv(_("Error!"), _("Please confirm that you know what you're doing by checking the option bellow!"))
287
288=== modified file 'l10n_ve_fiscal_requirements/wizard/wizard_invoice_nro_ctrl_view.xml'
289--- l10n_ve_fiscal_requirements/wizard/wizard_invoice_nro_ctrl_view.xml 2011-09-29 23:59:54 +0000
290+++ l10n_ve_fiscal_requirements/wizard/wizard_invoice_nro_ctrl_view.xml 2011-10-04 02:33:24 +0000
291@@ -17,26 +17,18 @@
292 </form>
293 </field>
294 </record>
295-
296- <act_window
297- name="Generate null paper"
298- res_model="wizard.invoice.nro.ctrl"
299- src_model="account.invoice"
300- view_mode="form"
301- key2="client_action_multi"
302- target="new"
303- id="menu_create_invoice_duplicate"
304- />
305-
306- <record id="wizard_invoice_nro_control" model="ir.actions.act_window">
307+ <record id="wizard_invoice_nro_control_action" model="ir.actions.act_window">
308 <field name="name">Create null paper</field>
309 <field name="res_model">wizard.invoice.nro.ctrl</field>
310- <field name="src_model">wizard.invoice.nro.ctrl</field>
311 <field name="view_type">form</field>
312 <field name="view_mode">tree,form</field>
313 <field name="view_id" ref="view_wizard_invoice_nro_ctrl"/>
314 <field name="target">new</field>
315+ <field name="context">{'menu': True}</field>
316 </record>
317-
318+ <menuitem name="Declare damaged paper" id="wizard_invoice_nro_ctrl_action"
319+ parent="account.menu_finance_receivables" action="wizard_invoice_nro_control_action"
320+ sequence="200"
321+ />
322 </data>
323 </openerp>
324
325=== modified file 'l10n_ve_fiscal_requirements/wizard/wizard_nro_ctrl_view.xml'
326--- l10n_ve_fiscal_requirements/wizard/wizard_nro_ctrl_view.xml 2011-09-30 23:39:52 +0000
327+++ l10n_ve_fiscal_requirements/wizard/wizard_nro_ctrl_view.xml 2011-10-04 02:33:24 +0000
328@@ -15,19 +15,15 @@
329 </form>
330 </field>
331 </record>
332- <record model="ir.actions.act_window" id="change_nro_ctrl_act">
333- <field name="name">Change Control Number</field>
334- <field name="res_model">wiz.nroctrl</field>
335- <field name="src_model">account.invoice</field>
336- <field name="view_type">form</field>
337- <field name="view_mode">form</field>
338- <field name="target">new</field>
339- </record>
340- <act_window
341- id="change_nro_ctrl_act"
342- res_model="wiz.nroctrl"
343+ <act_window
344+ name="Change control number"
345+ res_model="wiz.nroctrl"
346 src_model="account.invoice"
347- name="Change Control Number" />
348+ view_mode="form"
349+ key2="client_action_multi"
350+ target="new"
351+ id="action_wiz_nroctrl"
352+ />
353 </data>
354 </openerp>
355