Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
4 Trả lời
3612 Lượt xem

If I create a new field in an order and then a related field in the picking form like this:

 class sale_order(osv.osv):
    """Add comments"""
    _inherit = 'sale.order'

    _columns = {
        'comments': fields.text('Notas internas'),
    }

class stock_picking(osv.osv):
    _inherit = "stock.picking"
    _columns = {
        'comments': fields.text(related='sale_id.comments', store=True),
    }

When I confirm the order and the stock picking is created the field comments on the picking order is empty.

But if I modify it afterwards it gets updated. Any idea why it does not get updated / set on creation?


Thank you!

Ảnh đại diện
Huỷ bỏ

can you pls check the stock.picking Form Additional Info tab "Procurement Group" field data is generated?.. If value is generated then related field comment value display.

Tác giả

Hi Prakash, I don't fully understand your answer can you elaborate a little bit more? Also, do you know where is the code that generates the stock picking from the sale order? Thank you very much!

pls check the sale_stock.py file _get_sale_id function. https://github.com/odoo/odoo/blob/8.0/addons/sale_stock/sale_stock.py

Câu trả lời hay nhất

When you use the OpenERP v7, you need add the field 'comments' to 'stock.picking.in' and 'stock.picking.out'. 

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 3 18
4672
0
thg 11 19
2762
1
thg 2 16
6704
1
thg 9 24
1212
4
thg 12 23
17385