发票跳过按钮validasi并在odoo中注册付款

时间:2016-12-09 05:52:55

标签: python-2.7 odoo-8 openerp-8

invoice skip validate

  

我想创建自定义按钮,以便在发票中跳过此验证   注册付款,但仍然有效..

我尝试过使用此代码但无法使用

class SaleOrderTestingView(models.Model):
    _inherit = "account.invoice"

    def button_custom(self, cr, uid, ids, context=None):
        print ">>>>>>>>> berhasil bro haha"
        self.invoice_pay_customer(cr, uid, ids, context=context)

1 个答案:

答案 0 :(得分:0)

要自动验证草稿,请在创建发票后调用工作流程invoice_open。尝试以下代码:

 def create(self, cr, uid, vals, context=None):
    result=super(account_invoice, self).create(cr, uid, vals, context=context)
    self.signal_workflow(cr, uid, [result], 'invoice_open')
    return result