# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# 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/>.
#
##############################################################################
'update_xml': [
'security/ir.model.access.csv',
'account_invoice_layout_view.xml',
- 'account_invoice_layout_report.xml'
+ 'account_invoice_layout_report.xml',
+ 'wizard/account_invoice_special_message.xml',
],
'demo_xml': [],
'installable': True,
<?xml version="1.0"?>
<openerp>
<data>
- <wizard string="Invoices with Layout and Message"
+<!-- <wizard string="Invoices with Layout and Message"
model="account.invoice"
name="wizard.notify_message"
id="wizard_notify_message"
keyword="client_print_multi"
- />
+ /> -->
<report id="account_invoices_1"
string="Invoices with Layout"
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# 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 invoice_special_message
+import account_invoice_special_message
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
--- /dev/null
+# -*- 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 osv, fields
+
+class account_invoice_special_msg(osv.osv_memory):
+ _name = 'account.invoice.special.msg'
+ _description = 'Account Invoice Special Message'
+
+ _columns = {
+ 'message': fields.many2one('notify.message', 'Message', required = True, help="Message to Print at the bottom of report"),
+ }
+
+ def check_report(self, cr, uid, ids, context=None):
+ datas = {}
+ if context is None:
+ context = {}
+ data = self.read(cr, uid, ids, [])[0]
+ datas = {
+ 'ids': context.get('active_ids',[]),
+ 'model': 'account.invoice',
+ 'form': data
+ }
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'notify_account.invoice',
+ 'datas': datas,
+ }
+
+account_invoice_special_msg()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <record id="account_invoice_special_msg_view" model="ir.ui.view">
+ <field name="name">Account Invioce Special Message</field>
+ <field name="model">account.invoice.special.msg</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Select Message">
+ <group colspan="4" col="6">
+ <field name="message"/>
+ </group>
+ <separator colspan="4"/>
+ <group colspan="4" col="6">
+ <button special="cancel" string="Cancel" icon="gtk-cancel"/>
+ <button name="check_report" string="Print" type="object" icon="gtk-print"/>
+ </group>
+ </form>
+ </field>
+ </record>
+
+ <record id="action_account_invoice_special_msg" model="ir.actions.act_window">
+ <field name="name">Invoices with Layout and Message</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">account.invoice.special.msg</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="view_id" ref="account_invoice_special_msg_view"/>
+ <field name="target">new</field>
+ </record>
+
+ <record model="ir.values" id="account_invoice_special_msg_values">
+ <field name="model_id" ref="account.model_account_invoice" />
+ <field name="object" eval="1" />
+ <field name="name">Account Invioce Special Message</field>
+ <field name="key2">client_print_multi</field>
+ <field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_invoice_special_msg'))" />
+ <field name="key">action</field>
+ <field name="model">account.invoice</field>
+ </record>
+
+ </data>
+</openerp>
\ No newline at end of file
+++ /dev/null
-# -*- 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 wizard
-import time
-import datetime
-import pooler
-
-invoice_form = """<?xml version="1.0"?>
-<form string="Select Message">
- <field name="message"/>
-</form>"""
-
-invoice_fields = {
- 'message': {'string': 'Message', 'type': 'many2one', 'relation': 'notify.message', 'required': True},
- }
-
-class wizard_report(wizard.interface):
-
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type':'form', 'arch':invoice_form, 'fields':invoice_fields, 'state':[('end','Cancel'),('print','Print')]},
- },
- 'print': {
- 'actions': [],
- 'result': {'type':'print', 'report':'notify_account.invoice', 'state':'end'},
- },
- }
-
-wizard_report('wizard.notify_message')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-