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

Hello all, 

by mistake I missed up with the RFQ form ( purchase.order.form) , and now it doesn't show the sequence no# at the top , instead it shows " NEW " with no number.

If anyone can share the original template XML code  that would be great.

thanks.

 

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

Dear Ahmed

Check This Function and Make Sure didn't change or Oveeride by correct way:

    @api.model
    def create(self, vals):
        if vals.get('name', 'New') == 'New':
            vals['name'] = self.env['ir.sequence'].next_by_code('purchase.order') or '/'
        return super(PurchaseOrder, self).create(vals)

Also make sure the name field Exist on the xml file


I hope I helped You...

Ảnh đại diện
Huỷ bỏ
Tác giả

Thanks Ayman,

exactly what I needed ! much appreciated.