Merge lp:~vauxoo/openerp-venezuela-localization/miguel-split-invoice into lp:~openerp-venezuela/openerp-venezuela-localization/6.0-trunk

Proposed by Miguel Delgado (Vauxoo)
Status: Merged
Merged at revision: 554
Proposed branch: lp:~vauxoo/openerp-venezuela-localization/miguel-split-invoice
Merge into: lp:~openerp-venezuela/openerp-venezuela-localization/6.0-trunk
Diff against target: 150 lines (+117/-0)
4 files modified
l10n_ve_split_invoice/__init__.py (+2/-0)
l10n_ve_split_invoice/__openerp__.py (+1/-0)
l10n_ve_split_invoice/installer.py (+62/-0)
l10n_ve_split_invoice/installer_view.xml (+52/-0)
To merge this branch: bzr merge lp:~vauxoo/openerp-venezuela-localization/miguel-split-invoice
Reviewer Review Type Date Requested Status
Gabriela Quilarque Pending
Review via email: mp+89332@code.launchpad.net

Description of the change

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=== modified file 'l10n_ve_split_invoice/__init__.py'
2--- l10n_ve_split_invoice/__init__.py 2011-10-25 20:33:16 +0000
3+++ l10n_ve_split_invoice/__init__.py 2012-01-19 20:10:33 +0000
4@@ -22,5 +22,7 @@
5 # You should have received a copy of the GNU Affero General Public License
6 # along with this program. If not, see <http://www.gnu.org/licenses/>.
7 ##############################################################################
8+import installer
9 import res_company
10 import invoice
11+
12
13=== modified file 'l10n_ve_split_invoice/__openerp__.py'
14--- l10n_ve_split_invoice/__openerp__.py 2011-10-25 20:33:16 +0000
15+++ l10n_ve_split_invoice/__openerp__.py 2012-01-19 20:10:33 +0000
16@@ -56,6 +56,7 @@
17 "demo_xml" : [
18 ],
19 "update_xml" : [
20+ "installer_view.xml",
21 "view/company_view.xml",
22 ],
23 "active": False,
24
25=== added directory 'l10n_ve_split_invoice/images'
26=== added file 'l10n_ve_split_invoice/images/puente-maracaibo.jpg'
27Binary files l10n_ve_split_invoice/images/puente-maracaibo.jpg 1970-01-01 00:00:00 +0000 and l10n_ve_split_invoice/images/puente-maracaibo.jpg 2012-01-19 20:10:33 +0000 differ
28=== added file 'l10n_ve_split_invoice/installer.py'
29--- l10n_ve_split_invoice/installer.py 1970-01-01 00:00:00 +0000
30+++ l10n_ve_split_invoice/installer.py 2012-01-19 20:10:33 +0000
31@@ -0,0 +1,62 @@
32+#!/usr/bin/python
33+# -*- encoding: utf-8 -*-
34+###########################################################################
35+# Module Writen to OpenERP, Open Source Management Solution
36+# Copyright (C) OpenERP Venezuela (<http://openerp.com.ve>).
37+# All Rights Reserved
38+###############Credits######################################################
39+# Coded by: Vauxoo C.A.
40+# Planified by: Nhomar Hernandez
41+# Audited by: Vauxoo C.A.
42+#############################################################################
43+# This program is free software: you can redistribute it and/or modify
44+# it under the terms of the GNU Affero General Public License as published by
45+# the Free Software Foundation, either version 3 of the License, or
46+# (at your option) any later version.
47+#
48+# This program is distributed in the hope that it will be useful,
49+# but WITHOUT ANY WARRANTY; without even the implied warranty of
50+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
51+# GNU Affero General Public License for more details.
52+#
53+# You should have received a copy of the GNU Affero General Public License
54+# along with this program. If not, see <http://www.gnu.org/licenses/>.
55+################################################################################
56+from osv import osv
57+from osv import fields
58+from tools.translate import _
59+import base64
60+import addons
61+
62+class split_invoice_config(osv.osv_memory):
63+ """
64+ Fiscal Requirements installer wizard
65+ """
66+ _name = 'split.invoice.config'
67+ _inherit = 'res.config'
68+ _description= __doc__
69+
70+ def default_get(self, cr, uid, fields_list=None, context=None):
71+ defaults = super(split_invoice_config, self).default_get(cr, uid, fields_list=fields_list, context=context)
72+ logo = open(addons.get_module_resource('l10n_ve_split_invoice', 'images', 'puente-maracaibo.jpg'), 'rb')
73+ defaults['config_logo'] = base64.encodestring(logo.read())
74+ return defaults
75+
76+ def execute(self, cr, uid, ids, context=None):
77+ '''
78+ In this method I will configure the maximum number of lines in your invoices.
79+ '''
80+ wiz_data = self.browse(cr, uid, ids[0])
81+ company = self.pool.get('res.users').browse(cr, uid, uid).company_id
82+ company_obj = self.pool.get('res.company')
83+ company_id = company_obj.search(cr,uid,[('id','=',company.id)])
84+ data = {'lines_invoice': wiz_data.name}
85+ company_obj.write(cr, uid, company_id, data)
86+
87+ _columns = {
88+ 'name': fields.integer('Max Invoice Lines',required=True, help='Select the maximum number of lines in your customer invoices'),
89+ }
90+ _defaults={
91+ 'name': 50,
92+ }
93+split_invoice_config()
94
95=== added file 'l10n_ve_split_invoice/installer_view.xml'
96--- l10n_ve_split_invoice/installer_view.xml 1970-01-01 00:00:00 +0000
97+++ l10n_ve_split_invoice/installer_view.xml 2012-01-19 20:10:33 +0000
98@@ -0,0 +1,52 @@
99+<?xml version="1.0"?>
100+<openerp>
101+ <data>
102+ <record id="split_invoice_config_view" model="ir.ui.view">
103+ <field name="name">Configure Number of Lines in Your Customer Invoices </field>
104+ <field name="model">split.invoice.config</field>
105+ <field name="type">form</field>
106+ <field name="inherit_id" ref="base.res_config_view_base"/>
107+ <field name="arch" type="xml">
108+ <data>
109+ <form position="attributes">
110+ <attribute name="string">Split Invoice Configurator</attribute>
111+ </form>
112+ <separator string="title" position="attributes">
113+ <attribute name="string">Configure Customer Invoice Lines</attribute>
114+ </separator>
115+ <xpath expr="//label[@string='description']" position="attributes">
116+ <attribute name="string">
117+Configure your company with the maximum number
118+of lines in your customer invoices
119+ </attribute>
120+ </xpath>
121+ <xpath expr='//separator[@string="vsep"]' position='attributes'>
122+ <attribute name='rowspan'>5</attribute>
123+ <attribute name='string'></attribute>
124+ </xpath>
125+ <group string="res_config_contents" position="replace">
126+ <field name="name" groups="base.group_extended"/>
127+ <newline/>
128+ </group>
129+ <xpath expr='//button[@name="action_skip"]' position='replace'/>
130+ </data>
131+ </field>
132+ </record>
133+ <record id="action_config_split_invoice" model="ir.actions.act_window">
134+ <field name="name">Configure Withholdings VAT for Venezuela</field>
135+ <field name="type">ir.actions.act_window</field>
136+ <field name="res_model">split.invoice.config</field>
137+ <field name="view_id" ref="split_invoice_config_view"/>
138+ <field name="view_type">form</field>
139+ <field name="view_mode">form</field>
140+ <field name="target">new</field>
141+ </record>
142+ <!-- register configuration wizard -->
143+ <record id="config_wizard_step_split_invoice" model="ir.actions.todo">
144+ <field name="action_id" ref="action_config_split_invoice"/>
145+ <field name="restart">always</field>
146+ <field name="sequence">31</field>
147+ <field name="groups_id" eval="[(6,0,[ref('base.group_extended')])]"/>
148+ </record>
149+ </data>
150+</openerp>