[IMP] Account_invoice_layout
authorMustufa Rangwala <mra@mra-laptop>
Tue, 17 Aug 2010 05:48:28 +0000 (11:18 +0530)
committerMustufa Rangwala <mra@mra-laptop>
Tue, 17 Aug 2010 05:48:28 +0000 (11:18 +0530)
bzr revid: mra@mra-laptop-20100817054828-splbbuyn10jfgsn0

addons/account_invoice_layout/__init__.py
addons/account_invoice_layout/__openerp__.py
addons/account_invoice_layout/account_invoice_layout.py
addons/account_invoice_layout/account_invoice_layout_report.xml
addons/account_invoice_layout/account_invoice_layout_view.xml
addons/account_invoice_layout/report/report_account_invoice_layout.py
addons/account_invoice_layout/report/special_message_invoice.py
addons/account_invoice_layout/wizard/__init__.py
addons/account_invoice_layout/wizard/account_invoice_special_message.py

index 89827ee..779249d 100644 (file)
@@ -1,6 +1,6 @@
 # -*- 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 account_invoice_layout
 import report
 import wizard
+
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
 
index c050353..77a6e42 100644 (file)
@@ -37,7 +37,7 @@
     """,
     'author': 'OpenERP SA',
     'website': 'http://www.openerp.com',
-    'depends': ['base', 'account'],
+    'depends': ['account'],
     'init_xml': [],
     'update_xml': [
         'security/ir.model.access.csv',
index c4a4f64..e596dd0 100644 (file)
 #
 ##############################################################################
 
-from osv import fields,osv
-
+from osv import fields, osv
 
 class notify_message(osv.osv):
     _name = 'notify.message'
     _description = 'Notify By Messages'
     _columns = {
-        'name' :  fields.char('Title', size=64, required=True),
-        'msg' : fields.text('Special Message', size=125, required=True, help='This notification will appear at the bottom of the Invoices when printed.', translate=True)
+        'name':  fields.char('Title', size=64, required=True),
+        'msg': fields.text('Special Message', size=128, required=True, help='This notification will appear at the bottom of the Invoices when printed.', translate=True)
     }
 
 notify_message()
 
 class account_invoice_line(osv.osv):
 
-    def move_line_get_item(self, cr, uid, line, context={}):
+    def move_line_get_item(self, cr, uid, line, context=None):
         if line.state != 'article':
             return None
         return super(account_invoice_line, self).move_line_get_item(cr, uid, line, context)
@@ -70,7 +69,7 @@ class account_invoice_line(osv.osv):
                     res[field]['states'][key] = value
         return res
 
-    def onchange_invoice_line_view(self, cr, uid, id, type, context={}, *args):
+    def onchange_invoice_line_view(self, cr, uid, id, type, context=None, *args):
 
         if (not type):
             return {}
@@ -131,7 +130,7 @@ class account_invoice_line(osv.osv):
         default['state'] = self.browse(cr, uid, id).state
         return super(account_invoice_line, self).copy_data(cr, uid, id, default, context)
 
-    def _fnct(self, cr, uid, id, name, args, context):
+    def _fnct(self, cr, uid, id, name, args, context=None):
         res = {}
         for m in self.browse(cr, uid, id):
             if m.state != 'article':
@@ -165,18 +164,19 @@ class account_invoice_line(osv.osv):
 
     def _default_account(self, cr, uid, context=None):
         cr.execute("select id from account_account where parent_id IS NULL LIMIT 1")
-        res=cr.fetchone()
+        res = cr.fetchone()
         return res[0]
 
     _defaults = {
-        'state': lambda *a: 'article',
-        'sequence': lambda *a : 0,
+        'state': 'article',
+        'sequence': 0,
 #       'account_id': _default_account
     }
-account_invoice_line()
 
+account_invoice_line()
 
 class one2many_mod2(fields.one2many):
+
     def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None):
         if not context:
             context = {}
@@ -210,6 +210,7 @@ class account_invoice(osv.osv):
         'abstract_line_ids': fields.one2many('account.invoice.line', 'invoice_id', 'Invoice Lines',readonly=True, states={'draft':[('readonly',False)]}),
         'invoice_line': one2many_mod2('account.invoice.line', 'invoice_id', 'Invoice Lines',readonly=True, states={'draft':[('readonly',False)]}),
     }
+
 account_invoice()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
 
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
index 747bc83..4b21fcd 100644 (file)
@@ -1,12 +1,6 @@
 <?xml version="1.0"?>
 <openerp>
        <data>
-<!--   <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"
index 4bbb611..fdd4fa0 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0"?>
+
 <openerp>
     <data>
 
@@ -73,6 +74,7 @@
             <form string="Messages">
                 <separator string="Write a notification or a wishful message." colspan="4"/>
                 <field name="name" select="1" colspan="2" />
+                <newline/>
                 <field name="msg" select="1" colspan="2"/>
             </form>
         </field>
         <field name="view_type">form</field>
         <field name="view_mode">tree,form</field>
     </record>
+
     <menuitem name="Notification Message" id="menu_finan_config_notify_message" parent="account.menu_finance_configuration"/>
     <menuitem name="All Notification Messages" id="menu_notify_mesage_tree_form" action="notify_mesage_tree_form" parent="menu_finan_config_notify_message" groups="base.group_system"/>
 
-
-
     </data>
 </openerp>
index b2c1f37..54c0daa 100644 (file)
@@ -1,6 +1,6 @@
 # -*- 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 time
-import pooler
+
 from report import report_sxw
 
 class account_invoice_1(report_sxw.rml_parse):
index fdda2e6..aaa7978 100644 (file)
@@ -1,6 +1,6 @@
 # -*- 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 time
+
 from report import report_sxw
 import pooler
 
index 3b724ad..87cfa0d 100644 (file)
@@ -20,5 +20,6 @@
 ##############################################################################
 
 import account_invoice_special_message
+
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
 
index 5936e4c..adc3261 100644 (file)
@@ -18,6 +18,7 @@
 #    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):
@@ -32,17 +33,19 @@ class account_invoice_special_msg(osv.osv_memory):
         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