openerp-dev-web team mailing list archive
-
openerp-dev-web team
-
Mailing list archive
-
Message #04850
[Merge] lp:~openerp-dev/openobject-addons/ksa-import_quickbooks into lp:~openerp-dev/openobject-addons/apa-import_quickbooks
Kirti Savalia(OpenERP) has proposed merging lp:~openerp-dev/openobject-addons/ksa-import_quickbooks into lp:~openerp-dev/openobject-addons/apa-import_quickbooks.
Requested reviews:
OpenERP Core Team (openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/ksa-import_quickbooks/+merge/55711
create configuration wizard to store token and Realm_id in company.
--
https://code.launchpad.net/~openerp-dev/openobject-addons/ksa-import_quickbooks/+merge/55711
Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-addons/apa-import_quickbooks.
=== modified file 'quickbooks_ippids/__init__.py'
--- quickbooks_ippids/__init__.py 2011-03-29 08:34:58 +0000
+++ quickbooks_ippids/__init__.py 2011-03-31 09:18:26 +0000
@@ -20,6 +20,7 @@
##############################################################################
import wizard
import partner
+import config
=== modified file 'quickbooks_ippids/__openerp__.py'
--- quickbooks_ippids/__openerp__.py 2011-03-31 06:16:31 +0000
+++ quickbooks_ippids/__openerp__.py 2011-03-31 09:18:26 +0000
@@ -28,8 +28,8 @@
'author': 'OpenERP SA',
'website': 'http://www.openerp.com',
'depends': ['base'],
- 'init_xml': ['base_data.xml'],
- 'update_xml': ['wizard/quickbooks_ippids_import_data.xml','partner_view.xml'],
+ 'init_xml': ['base_data.xml'],
+ 'update_xml': ['wizard/quickbooks_ippids_import_data.xml','partner_view.xml','config_view.xml'],
'demo_xml': [],
'test': [],
'installable': True,
=== renamed file 'quickbooks_ippids/company.py' => 'quickbooks_ippids/config.py'
--- quickbooks_ippids/company.py 2011-03-29 08:34:58 +0000
+++ quickbooks_ippids/config.py 2011-03-31 09:18:26 +0000
@@ -0,0 +1,54 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from osv import osv, fields
+
+class quick_installer(osv.osv_memory):
+ """
+ """
+ _name = 'quick.installer'
+ _inherit = 'res.config.installer'
+ _columns = {
+ 'token': fields.char('Token', size=512, required=True, help="Token"),
+ 'realm_id': fields.char('Realm ID', size=512, required=True, help="Realm ID"),
+ }
+
+ def action_next(self, cr, uid, ids, context=None):
+ quick_obj = self.pool.get('quick.installer')
+ for quick in quick_obj.browse(cr, uid, ids, context=context):
+ self.pool.get('res.company').write(cr, uid, ids, {'token': quick.token,'realm_id':quick.realm_id})
+ self._set_previous_todo(cr, uid, state='done', context=context)
+ next = self.execute(cr, uid, ids, context=None)
+ if next: return next
+ return self.next(cr, uid, ids, context=context)
+
+quick_installer()
+
+class res_company(osv.osv):
+ _inherit = 'res.company'
+ _columns = {
+ 'token': fields.char('Token', size=512, required=True, help="Token"),
+ 'realm_id': fields.char('Realm ID', size=512, required=True, help="Token"),
+ }
+
+res_company()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== renamed file 'quickbooks_ippids/company_view.xml' => 'quickbooks_ippids/config_view.xml'
--- quickbooks_ippids/company_view.xml 2011-03-29 08:34:58 +0000
+++ quickbooks_ippids/config_view.xml 2011-03-31 09:18:26 +0000
@@ -0,0 +1,65 @@
+<openerp>
+ <data>
+ <record id="view_quick_installer" model="ir.ui.view">
+ <field name="name">quick.installer.view</field>
+ <field name="model">quick.installer</field>
+ <field name="type">form</field>
+ <field name="inherit_id" ref="base.res_config_installer"/>
+ <field name="arch" type="xml">
+ <data>
+ <xpath expr='//separator[@string="title"]' position='attributes'>
+ <attribute name='string'>Quickbooks Ippids Configuration</attribute>
+ </xpath>
+
+ <xpath expr="//label[@string='description']" position="attributes">
+ <attribute name="string"></attribute>
+ </xpath>
+
+ <xpath expr='//separator[@string="vsep"]' position='attributes'>
+ <attribute name='rowspan'>10</attribute>
+ <attribute name='string'></attribute>
+ </xpath>
+
+ <group colspan="8">
+ <group colspan="4" col="4" groups="base.group_extended" name="other" width="400">
+ <field name="token"/>
+ <newline/>
+ <field name="realm_id"/>
+ </group>
+ </group>
+ </data>
+ </field>
+ </record>
+
+ <record id="action_quick_installer" model="ir.actions.act_window">
+ <field name="name">QUICKBOOK Application Configuration</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">quick.installer</field>
+ <field name="view_id" ref="view_quick_installer"/>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="target">new</field>
+ </record>
+
+ <record id="quick_installer_todo" model="ir.actions.todo">
+ <field name="action_id" ref="action_quick_installer"/>
+ <field name="sequence">3</field>
+ <field name="restart">always</field>
+ </record>
+
+ <record model="ir.ui.view" id="view_company_form_inherit">
+ <field name="name">view.company.form</field>
+ <field name="type">form</field>
+ <field name="model">res.company</field>
+ <field name="inherit_id" ref="base.view_company_form"/>
+ <field name="arch" type="xml">
+ <page string="Configuration" position="inside">
+ <separator string="Quickbooks Configuration" colspan="4"/>
+ <newline/>
+ <field name="token"/>
+ <field name="realm_id"/>
+ </page>
+ </field>
+ </record>
+ </data>
+</openerp>
=== modified file 'quickbooks_ippids/wizard/quickbooks_ippids_import_data.py'
--- quickbooks_ippids/wizard/quickbooks_ippids_import_data.py 2011-03-31 07:17:56 +0000
+++ quickbooks_ippids/wizard/quickbooks_ippids_import_data.py 2011-03-31 09:18:26 +0000
@@ -49,8 +49,10 @@
password = ippids_config_rec.password
#need to fetch this from res.company:Not Implement yet.
- token='d573nmwdnmfki9dwhs49rchv8csa'
- company_realm_id='199646053'
+ company_obj = self.pool.get('res.company')
+ for company_data in company_obj.browse(cr, uid, ids, context=context):
+ token = company_data.token
+ realm_id=company_data.realm_id
#make connection with IPP
conn = IPP();