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

Send ids from stock.picking.in to stock.move

By
Edison Ibañez
on 8/22/13, 4:55 PM 1,405 views

Greetings ..

Stock.picking.in add fields:

stock_picking_in class (osv.osv)
 _inherit = "stock.picking.in"

 _columns = {
     'purchaser_id': fields.many2one ('res.users', 'Purchaser', select = True),
     'customer_id': fields.many2one ('res.partner', 'Customer', select = True),
 }

and stock.move:

class stock_move(osv.osv):
_inherit = 'stock.move'

_columns = {
    'select_a':fields.related('picking_id', 'purchaser_id', type='many2one', relation='res.users', store=True, string='A'),
    'select_b':fields.related('picking_id', 'customer_id', type='many2one', relation='res.partner', store=True, string='B'),
}

I want to do is the following, in the form of stock.picking.in select the buyer and the customer, once you have done this, adding stock.move products, I want the client and the buyer chose in stock.picking . in selecionados may be already in the form of stock, move ..

Any ideas, or any module that does something similar ...

Thank you ...

0

Borni DHIFI

--Borni DHIFI--
5102
| 6 8 9
Tunis, Tunisia
--Borni DHIFI--

Techno Functional Consultant Odoo(OpenERP) 

http://www.linkedin.com/in/borni

Skype : dhifi.borni

Borni DHIFI
On 8/22/13, 7:41 PM

Hi,

field related :

Sometimes you need to refer to the relation of a relation. For example, supposing you have objects: City -> State -> Country, and you need to refer to the Country from a City, you can define a field as below in the City object:

'country_id': fields.related(
    'state_id',
    'country_id',
    type="many2one",
    relation="res.country",
    string="Country",
    store=False)

https://doc.openerp.com/v6.0/developer/2_5_Objects_Fields_Methods/field_type.html/#relational-types

so,

'select_a':fields.related('picking_id', 'purchaser_id', type='many2one', relation='stock.picking.in', store=True, string='A'),
'select_b':fields.related('picking_id', 'customer_id', type='many2one', relation='stock.picking.in', store=True, string='B'),

thanks for responding, I try but this way I get is, the id of incoming overlap, and not the computer or the clients

Edison Ibañez
on 8/22/13, 7:46 PM

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: 8/22/13, 4:55 PM
Seen: 1405 times
Last updated: 3/16/15, 8:10 AM