Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
3274 Ansichten

I have a class defined like this:

class mymodule_thing(osv.osv):
    _name = "mymodule.thing",
    _columns = {
        #some columns in the parent class
    }

Then, I have two children of that;

class mymodule_thing_type_a(osv.osv):
    _name = "mymodule.thing_type_a",
    _columns = {
         #some columns only in type a
    }

class mymodule_thing_type_b(osv.osv):
    _name = "mymodule.thing_type_b",
    _columns = {
         #some columns only in type a
    }

My problem is with workflow. I tried defining the same workflow on three different osvs like this:

<record model="workflow" id="wkf_mymodule_thing">
    <field name="name">mymodule_thing.wkf</field>
    <field name="osv">mymodule.thing</field>
    <field name="on_create">True</field>
</record>

<record model="workflow" id="wkf_mymodule_thing">
    <field name="name">mymodule_thing.wkf</field>
    <field name="osv">mymodule.thing_a</field>
    <field name="on_create">True</field>
</record>

<record model="workflow" id="wkf_mymodule_thing">
    <field name="name">mymodule_thing.wkf</field>
    <field name="osv">mymodule.thing_b</field>
    <field name="on_create">True</field>
</record>

but, that didn't work. (What happened was that the workflow only worked for thing_b, the last to be declared).

Defining the workflow only on mymodule.thing didn't work either. The workflow wasn't applied to the child objects.

The only way that I've figured out to do what I need is to declare three different workflows, one for the parent, and then one for each of the children. That's unmaintainable.

Any ideas?

Avatar
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
1
März 15
4397
1
Aug. 25
406
2
Juli 25
574
1
Juli 25
527
2
Juli 25
554