Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
3578 Zobrazení

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
Zrušit

You posted this question twice.

Related Posts Odpovědi Zobrazení Aktivita
1
říj 15
6238
0
úno 25
1305
0
led 25
1129
1
pro 24
1448
1
čvn 22
5575