Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/variables/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Workflow OpenERP 7-将其他状态添加到account.invoice工作流_Workflow_Openerp_Odoo - Fatal编程技术网

Workflow OpenERP 7-将其他状态添加到account.invoice工作流

Workflow OpenERP 7-将其他状态添加到account.invoice工作流,workflow,openerp,odoo,Workflow,Openerp,Odoo,我想向account.invoice的工作流添加另一个状态advanced,介于open和paid之间。 所以我继承了这个模块 class advance_invoice_workflow(osv.osv) : _name = 'account.invoice' _inherit = "account.invoice" _columns = { 'state': fields.selection([ ('draft','Draft'),

我想向account.invoice的工作流添加另一个状态advanced,介于open和paid之间。 所以我继承了这个模块

class advance_invoice_workflow(osv.osv) :
    _name = 'account.invoice'
    _inherit = "account.invoice"
    _columns = {
    'state': fields.selection([
        ('draft','Draft'),
        ('proforma','Pro-forma'),
        ('proforma2','Pro-forma'),
        ('open','Open'),
        ('advanced','Advanced'),
        ('paid','Paid'),
        ('paid_advanced','Paid advanced'),
        ('cancel','Cancelled'),
        ],'Status', select=True, readonly=True, track_visibility='onchange',
        help='* The \'Draft\' status is used when a user is encoding a new and unconfirmed Invoice. \
            \n* The \'Pro-forma\' when invoice is in Pro-forma status,invoice does not have an invoice number. \
            \n* The \'Open\' status is used when user create invoice,a invoice number is generated.Its in open status till user does not pay invoice. \
            \n* The \'Paid\' status is set automatically when the invoice is paid. Its related journal entries may or may not be reconciled. \
            \n* The \'Cancelled\' status is used when user cancel invoice. \
        '),
    }
并通过

    <record id="act_advanced" model="workflow.activity">
        <field name="wkf_id" ref="account.wkf" />
        <field name="name">advanced</field>
        <field name="kind">function</field>
        <field name="action">set_advanced()</field>
    </record>
所有变量都是正确的,但trg_validate返回False。 我怎么了

谢谢,
Patrizio

我解决了将流程图管理委托给从account.invoice继承的另一个类的问题

class advance_invoice_account_ui(osv.osv) :
    _name = 'account.invoice'
    _inherit = "account.invoice"
<record id="t1" model="workflow.transition">
    <field name="act_from" ref="act_advanced"/>
    <field name="act_to" ref="account.act_paid"/>
    <field name="trigger_model">account.move.line</field>
    <field name="trigger_expr_id">move_line_id_payment_get()</field>
    <field name="condition">test_paid()</field>
</record>
def button_confirm_advance(self,cr,uid,ids,context=None):
    context = context or {}
    for invoice in self.browse(cr,uid,ids,context=context):
        wf_service = netsvc.LocalService("workflow")
        self.write(cr, uid, [invoice.id],{})
        wf_service.trg_validate(uid,'account.invoice',invoice.id,'button_confirm_advance',cr)   
    return {'type': 'ir.actions.act_window_close'}
class advance_invoice_account_ui(osv.osv) :
    _name = 'account.invoice'
    _inherit = "account.invoice"