我想创建自定义按钮,以便在发票中跳过此验证 注册付款,但仍然有效..
我尝试过使用此代码但无法使用
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)
答案 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