Ujjvala Collins (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-wizard_osv_memory_convert-uco into 
lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-wizard_osv_memory_convert-uco/+merge/74158

[IMP] account_asset:
----------------------------------
* Converted "Close Asset" wizard to osv_memory wizard. (Right now not used 
anywhere)
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-wizard_osv_memory_convert-uco/+merge/74158
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-wizard_osv_memory_convert-uco.
=== modified file 'account_asset/__openerp__.py'
--- account_asset/__openerp__.py	2011-07-11 12:51:50 +0000
+++ account_asset/__openerp__.py	2011-09-06 04:57:24 +0000
@@ -1,6 +1,6 @@
 # -*- encoding: utf-8 -*-
 ##############################################################################
-#    
+#
 #    OpenERP, Open Source Management Solution
 #    Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
 #
@@ -15,7 +15,7 @@
 #    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/>.     
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 ##############################################################################
 
@@ -25,7 +25,7 @@
     "depends" : ["account"],
     "author" : "Tiny",
     "description": """Financial and accounting asset management.
-    This Module manages the assets owned by a company or an individual. It will keep track of depreciation's occurred on 
+    This Module manages the assets owned by a company or an individual. It will keep track of depreciation's occurred on
     those assets. And it allows to create Move's of the depreciation lines.
     """,
     "website" : "http://www.openerp.com";,
@@ -42,10 +42,11 @@
         "account_asset_wizard.xml",
         "wizard/account_asset_change_duration_view.xml",
         "wizard/wizard_asset_compute_view.xml",
+#        "wizard/wizard_asset_close_view.xml",
         "account_asset_view.xml",
         "account_asset_invoice_view.xml",
         "report/account_asset_report_view.xml",
-	
+
     ],
     "active": False,
     "installable": True,

=== modified file 'account_asset/wizard/wizard_asset_close.py'
--- account_asset/wizard/wizard_asset_close.py	2011-03-30 13:25:27 +0000
+++ account_asset/wizard/wizard_asset_close.py	2011-09-06 04:57:24 +0000
@@ -1,6 +1,6 @@
 # -*- encoding: utf-8 -*-
 ##############################################################################
-#    
+#
 #    OpenERP, Open Source Management Solution
 #    Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
 #
@@ -15,37 +15,25 @@
 #    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/>.     
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 ##############################################################################
 
-import wizard
-import pooler
-
-asset_end_arch = '''<?xml version="1.0"?>
-<form string="Close asset">
-    <separator string="General information" colspan="4"/>
-</form>'''
-
-asset_end_fields = {
-}
-
-class wizard_asset_close(wizard.interface):
-    states = {
-        'init': {
-            'actions': [],
-            'result': {'type':'form', 'arch':asset_end_arch, 'fields':asset_end_fields, 'state':[
-                ('end','Cancel'),
-                ('asset_close','End of asset')
-            ]}
-        },
-        'asset_close': {
-            'actions': [],
-            'result': {'type' : 'state', 'state': 'end'}
-        }
-    }
-wizard_asset_close('account.asset.close')
-
+from osv import osv, fields
+
+class wizard_asset_close(osv.osv_memory):
+    _name = 'account.asset.close'
+    _description = 'Close Asset'
+
+    def asset_close(self, cr, uid, ids, context=None):
+#        TODO: Need to improve
+#        asset_obj = self.pool.get('account.asset.asset')
+#        asset_ids = context and context.get('active_ids') or []
+#        for asset in asset_obj.browse(cr, uid, asset_ids, context=context):
+#            if asset.state == 'open':
+#                asset_obj.set_to_close(cr, uid, asset.id, context=context)
+        return {'type': 'ir.actions.act_window_close'}
+
+wizard_asset_close()
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-

=== added file 'account_asset/wizard/wizard_asset_close_view.xml'
--- account_asset/wizard/wizard_asset_close_view.xml	1970-01-01 00:00:00 +0000
+++ account_asset/wizard/wizard_asset_close_view.xml	2011-09-06 04:57:24 +0000
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+
+        <record id="view_asset_close" model="ir.ui.view">
+            <field name="name">account.asset.close.wizard</field>
+            <field name="model">account.asset.close</field>
+            <field name="type">form</field>
+            <field name="arch" type="xml">
+                <form string="Close Asset">
+                    <separator string="Close Asset" colspan="4"/>
+                    <label string="This wizard will close the asset(s)." colspan="4"/>
+                    <separator string="" colspan="4"/>
+                    <group colspan="4" col="6">
+                       <label string="" colspan="2"/>
+                       <button icon="gtk-cancel" special="cancel" string="Cancel"/>
+                       <button icon="gtk-close" string="Close Asset" name="asset_close" type="object"/>
+                    </group>
+                 </form>
+            </field>
+        </record>
+
+        <!--  <act_window
+            id="act_asset_close"
+            res_model="account.asset.close"
+            src_model="account.asset.asset"
+            target="new"
+            name="Close Asset"
+            view_mode="form"
+            key2="client_action_multi"
+         />-->
+
+    </data>
+</openerp>

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to