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

What I mean is that;

Model with name "stock.return.picking" has "location_id" field. 

When I click on the return button , I want to see all the location_id. But location_id has domain:

location_id = fields.Many2one(  'stock.location', 'Return Location',

       domain="['|', ('id', '=', original_location_id), '&', ('return_location', '=', True), ('id', 'child_of',     parent_location_id)]")


How can I change this domain?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi..

You need to inherit the model stock.return.picking and just re-define the field.

class ClassName(models.Model):

     _inherit = 'stock.return.picking'

    location_id = fields.Many2one(  'stock.location', domain=[])

Thanks

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 1 20
12528
1
thg 1 20
5129
1
thg 3 23
2883
2
thg 12 22
24403
0
thg 3 20
4499