Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Add new field in stock.move

By
cahyo
on 12/26/13, 12:40 AM 575 views

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.

You posted this question twice.

Bista Solutions US, Ray Carnes
on 12/26/13, 1:11 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 12/26/13, 12:40 AM
Seen: 575 times
Last updated: 3/16/15, 8:10 AM