Skip to Content
Menú
This question has been flagged
3593 Vistes

Hi All, I want to add new field in stock.move and this is my code

import time

from openerp.osv import fields, osv

class bac_stock_move(osv.osv):
    _inherit = 'stock.move'
    _name = 'bac.stock.move'
    _description = 'bac_stock_move'

    _columns = {
        'supplier_id' : fields.many2one('res.partner', 'Supplier', domain=[('supplier','=','1')]),
        'customer_id' : fields.many2one('res.partner', 'Customer', domain=[('customer','=','1')]),
    }
bac_stock_move()

<?xml version="1.0"?>
<openerp>
    <data>

    <record id="bac_stock_move_form" model="ir.ui.view">
    <field name="name">bac.stock.move.form</field>
    <field name="model">stock.move</field>
    <field name="inherit_id" ref="stock.view_move_form"/>
    <field name="arch" type="xml">

      <xpath expr="//group[@name='main_grp']/field[@name='name']" position="after">
        <field name="partner_id" attrs="{'visible':True}"/>
        <field name="supplier_id"/>
        <field name="supplier_id"/>
      </xpath>

    </field>
    </record>


    </data>
</openerp>

Does it possible to group field by menu, not by user group. I want to show Supplier Field in menu Incoming product and Customer field in menu Outgoing Product. and hide supplier field when the current menu is outgoing product and hide customer menu when the current menu is incoming product. this 2 menu use only 1 view.

Avatar
Descartar

You posted this question twice.

Related Posts Respostes Vistes Activitat
1
d’oct. 15
6248
0
de febr. 25
1310
0
de gen. 25
1134
1
de des. 24
1457
1
de juny 22
5589