Rajesh Prajapati (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-account_check_writing-rpr into 
lp:openobject-addons.

Requested reviews:
  Divyesh Makwana(OpenERP) (mdi-openerp)
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-account_check_writing-rpr/+merge/135868


Hello

     Improved check writing module as per requirement


Thanks,
Rajesh
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-account_check_writing-rpr/+merge/135868
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-account_check_writing-rpr.
=== modified file 'account_check_writing/__openerp__.py'
--- account_check_writing/__openerp__.py	2012-08-22 13:02:32 +0000
+++ account_check_writing/__openerp__.py	2012-11-26 06:09:19 +0000
@@ -30,6 +30,7 @@
     'website': 'http://www.openerp.com',
     'depends' : ['account_voucher'],
     'data': [
+        'wizard/account_check_view.xml',
         'account_check_writing_report.xml',
         'account_view.xml',
         'account_voucher_view.xml',

=== added directory 'account_check_writing/wizard'
=== added file 'account_check_writing/wizard/__init__.py'
--- account_check_writing/wizard/__init__.py	1970-01-01 00:00:00 +0000
+++ account_check_writing/wizard/__init__.py	2012-11-26 06:09:19 +0000
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2004-2010 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/>.
+#
+##############################################################################
+
+import account_check
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== added file 'account_check_writing/wizard/account_check.py'
--- account_check_writing/wizard/account_check.py	1970-01-01 00:00:00 +0000
+++ account_check_writing/wizard/account_check.py	2012-11-26 06:09:19 +0000
@@ -0,0 +1,68 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2004-2010 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 fields, osv
+
+class account_check_write(osv.osv_memory):
+    _name = 'account.check.write'
+    _description = 'Assign Check Number'
+
+    _columns = {
+        'check_number': fields.char('Check Number', required=True, help="The Check Number."),
+    }
+
+    _defaults = {
+        'check_number': lambda obj, cr, uid, context:obj.pool.get('ir.sequence').get(cr, uid, 'check.number'),
+   }
+
+    def print_check_write(self, cr, uid, ids, context=None):
+        voucher_obj = self.pool.get('account.voucher')
+        if context is None:
+            context = {}
+        voucher_ids = context.get('active_ids', [])
+        number = int(self.browse(cr, uid, ids[0], context=context).check_number)
+        if voucher_ids:
+            checks = voucher_obj.browse(cr, uid, voucher_ids, context=context)
+            for check in checks:
+                voucher_obj.write(cr, uid, [check.id], {'number': str(number)}, context=context)
+                number += 1
+
+        check_layout_report = {
+            'top' : 'account.print.check.top',
+            'middle' : 'account.print.check.middle',
+            'bottom' : 'account.print.check.bottom',
+        }
+
+        check_layout = voucher_obj.browse(cr, uid, voucher_ids[0], context=context).company_id.check_layout
+        if not check_layout:
+            check_layout = 'top'
+        return {
+            'type': 'ir.actions.report.xml', 
+            'report_name':check_layout_report[check_layout],
+            'datas': {
+                'model':'account.voucher',
+                'ids': voucher_ids,
+                'report_type': 'pdf'
+                },
+            'nodestroy': True
+            }
+
+account_check_write()
+

=== added file 'account_check_writing/wizard/account_check_view.xml'
--- account_check_writing/wizard/account_check_view.xml	1970-01-01 00:00:00 +0000
+++ account_check_writing/wizard/account_check_view.xml	2012-11-26 06:09:19 +0000
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data noupdate="0">
+
+        <record id="view_account_check_write" model="ir.ui.view">
+            <field name="name">account.check.form</field>
+            <field name="model">account.check.write</field>
+            <field name="arch" type="xml">
+                <form string="Check" version="7.0">
+                    <group col="4">
+                        <field name="check_number"/>
+                    </group>
+                    <footer>
+                        <button name="print_check_write" string="Print Check" type="object" class="oe_highlight"/> or
+                        <button string="Cancel" class="oe_link" special="cancel"/>
+                    </footer>
+                </form>
+            </field>
+        </record>
+
+        <act_window id="action_account_check_write"
+            multi="True"
+            name="Check Write"
+            res_model="account.check.write" src_model="account.voucher"
+            view_mode="form" target="new" view_type="form" /> 
+
+    </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