Skip to Content
Menu
This question has been flagged
4600 Views

i'm using odoo 8 and i have installed a custom module cmms after that ,i develop my needs. I want to define the product that i need to use when i repair my equipment. That product is stocked in my stock so that when i inser the product that i use my stock will be decrease. So i added some code but my problem is when i press "add element" of product it shows error "ValueError: Wrong value for stock.picking.priority: 'normal'" Any idea for help please ? i'm stuck with this problem

intervention.xml

 <record id="view_intervention_form" model="ir.ui.view">
        <field name="name">cmms.intervention.form</field>
        <field name="model">cmms.intervention</field>
        <field name="type">form</field>
        <field name="arch" type="xml">
            <form string="Intervention request" version="7.0">
                <header>
                    <button name="action_broadcast"  type="object" string="Déffuser mail" icon="STOCK_REDO"/>
                    <button name="action_done" states="draft" string="Valider" type="object" icon="gtk-apply"/>
                    <button name="action_cancel" states="done," string="Annuler" type="object"  icon="gtk-cancel"/>
                    <button name="action_draft" states="cancel" string="Remettre en brouillon" type="object" icon="terp-stock_effects-object-colorize"/>
                    <field name="state" widget="statusbar" />
                </header>
                <sheet>
                <group>
                <group>
                <field name="name" select="1" />
                <field name="user_id" select="1" colspan="1" />
                <field name="user2_id"  />
                <field name="priority"  />
                <field name="state_machine" />
                </group>
                <group>
                <field name="type" select="1" colspan="1" />
                <field name="equipment_id" select="1" colspan="1" />
                <field name="date_inter"  />
                <field name="date_end"  />
                </group>
                </group>
                <separator colspan="4" string="Piéce de rechange"/>

                   <field name="move_lines"/>
                <newline />
                <notebook colspan="1">
                    <page string="Motif d'intervention">
                        <field name="motif" />
                    </page>
                    <page string="Observation">
                        <field name="observation" />
                    </page>
                    <!--<page string="Piéces de rechange utilisé">-->
                        <!--&lt;!&ndash;<field name="move_lines" />&ndash;&gt;-->
                        <!--<field name="piéce de rechange"/>-->
                        <!--<field name="quantite"/>-->
                    <!--</page>-->

                    <!--<page string="Stock de Piéces de rechange">-->
                        <!--<field name="move_lines" />-->
                    <!--</page>-->
                </notebook>

                </sheet>
                <div class="oe_chatter">
                    <field name="message_follower_ids" widget="mail_followers"/>
                    <field name="message_ids" widget="mail_thread"/>
                </div>
            </form>
        </field>
    </record>

intervention.py

 class cmms_intervention(osv.osv):
_inherit = "cmms.intervention"
_columns = {
     'move_lines': fields.one2many('stock.move', 'picking_id', copy=True),}


Avatar
Discard
Related Posts Replies Views Activity
0
May 15
5066
1
Apr 15
3239
1
Jul 19
2352
0
Nov 18
3380
2
Nov 18
3245