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

HI, I am importing dataset from xlsx sheet, Our name and id are same for the product. And Name and id are made up of combination of some attribute. So our sheet contains an id which I am mapping it to the external ID and also to the names of product in inventory (by writing function ) . Now whenever I am creating new product from UI I want its external Id to be same as name of the product. Anyone Please help me with solution.

Here is the function that create the name of the product while importing..

@api.depends('gpo', 'gen', 'esp', 'dif', 'var')
def _get_name_of_product(self):
for record in self:
record.name = '{}{}{}{}{}'.format(record.gpo, record.gen , record.esp , record.dif , record.var)
Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 3 25
1615
1
thg 2 25
3065
2
thg 2 25
2028
1
thg 3 24
1573
1
thg 4 22
2437