[IMP] Account_invoice_layout
bzr revid: mra@mra-laptop-20100817054828-splbbuyn10jfgsn0
This commit is contained in:
parent
c3a34ce07d
commit
68686b1074
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
|
@ -15,12 +15,13 @@
|
|||
# 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:
|
||||
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -19,22 +19,21 @@
|
|||
#
|
||||
##############################################################################
|
||||
|
||||
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()
|
||||
|
||||
|
||||
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:
|
||||
|
||||
account_invoice()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -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"
|
||||
|
|
|
@ -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>
|
||||
|
@ -83,10 +85,9 @@
|
|||
<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>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
|
@ -15,12 +15,12 @@
|
|||
# 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):
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
|
@ -15,11 +15,12 @@
|
|||
# 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
|
||||
|
||||
|
|
|
@ -20,5 +20,6 @@
|
|||
##############################################################################
|
||||
|
||||
import account_invoice_special_message
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
|
@ -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:
|
Loading…
Reference in New Issue