mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
Merge pull request #107 from StefanRijnhart/8.0-fix_invoice_state_selection
[FIX] Cannot extend selection if object is not fully initialized
This commit is contained in:
@@ -126,7 +126,7 @@ from openerp.tools.translate import _
|
||||
class AccountInvoice(orm.Model):
|
||||
_inherit = "account.invoice"
|
||||
|
||||
def __init__(self, pool, cr):
|
||||
def _register_hook(self, cr):
|
||||
"""
|
||||
Adding a state to the hardcoded state list of the inherited
|
||||
model. The alternative is duplicating the field definition
|
||||
@@ -135,9 +135,7 @@ class AccountInvoice(orm.Model):
|
||||
Maybe apply a similar trick when overriding the buttons' 'states'
|
||||
attributes in the form view, manipulating the xml in fields_view_get().
|
||||
"""
|
||||
super(AccountInvoice, self).__init__(pool, cr)
|
||||
invoice_obj = pool.get('account.invoice')
|
||||
invoice_obj._columns['state'].selection.append(
|
||||
self._columns['state'].selection.append(
|
||||
('debit_denied', 'Debit denied'))
|
||||
|
||||
def action_debit_denied(self, cr, uid, ids, context=None):
|
||||
|
||||
Reference in New Issue
Block a user