Put the fiscal reports as an extra state in account.invoice.
bzr revid: p_christ@hol.gr-20101028122407-4tgvkr2eubbdn52p
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
|
||||
import fiscal_prints
|
||||
import account_invoice_print
|
||||
import wizard
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
],
|
||||
"demo_xml" : [
|
||||
],
|
||||
"update_xml" : [ "account_fiscalgr_view.xml",
|
||||
"update_xml" : [ "account_fiscalgr_view.xml", "account_invoice_report.xml"
|
||||
],
|
||||
"active": False,
|
||||
"installable": True
|
||||
|
||||
@@ -28,5 +28,18 @@
|
||||
<menuitem name="Fiscal prints" id="menu_account_fiscalgr" parent="account.menu_finance_reporting"/>
|
||||
<menuitem name="All Prints" id="menu_account_fiscalgr_print_tree_form" action="view_account_fiscalgr_print_tree_form" parent="menu_account_fiscalgr"/>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_invoice_fiscalgr_inherit_1">
|
||||
<field name="name">account.invoice.fiscalgr.view.inherit_1</field>
|
||||
<field name="model">account.invoice</field>
|
||||
<field name="inherit_id" ref="account.invoice_form"/>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="/form/notebook/page/group/group/button[@name='invoice_cancel']" position="before">
|
||||
<button name="action_fiscalgr_print" states="open" string="Print" type="object"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -27,6 +27,15 @@ class account_invoice(osv.osv):
|
||||
_columns = {
|
||||
# states={'open':[('readonly',False)]}
|
||||
'fiscalgr_print': fields.many2one('account.fiscalgr.print','Fiscal print', readonly=True, ),
|
||||
'state': fields.selection([
|
||||
('draft','Draft'),
|
||||
('proforma','Pro-forma'),
|
||||
('proforma2','Pro-forma'),
|
||||
('open','Open'),
|
||||
('paid','Done'),
|
||||
('cancel','Canceled'),
|
||||
('printed','Printed'),
|
||||
],'State', select=True, readonly=True),
|
||||
}
|
||||
def copy(self, cr, uid, id, default=None, context=None):
|
||||
if default is None:
|
||||
@@ -42,6 +51,9 @@ class account_invoice(osv.osv):
|
||||
if i['fiscalgr_print']:
|
||||
raise osv.except_osv(_('Invalid action !'), _('Cannot cancel invoice(s) which are already printed !'))
|
||||
return super(account_invoice,self).action_cancel(cr,uid,ids,args)
|
||||
|
||||
def action_fiscalgr_print(self, cr, uid, ids, *args):
|
||||
raise osv.except_osv(_('Invalid action !'), _('Cannot print such an invoice !'))
|
||||
|
||||
account_invoice()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
Reference in New Issue
Block a user