تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
7892 أدوات العرض

Hi,

I created a new costom model product:

class costum_product(models.Model):
    _name = "costum.product"
    _inherit = "product.product"
    _description = "Costum Product Description"
    name = fields.Char('Description', required= True)
    code = fields.Integer('Code', required= True)
    category_id = fields.Many2one('randa.category','Category')

And I tried to link it to sale module instead of the standard odoo product module:

class myModuleSaleOrderLine(models.Model):  
    _inherit = 'sale.order.line'
    custom_product_id = fields.Many2one('costum.product', string='Product', ondelete='restrict', change_default=True, required=True)

 Now when I go to sales orders and add a sale order line, I can't add any line, whatever I do to save I got this warning:

The line has been modified, your changes will be discarded. Are you sure you want to discard the changes ?

And I can't add any line.

الصورة الرمزية
إهمال
أفضل إجابة

Hi,

In the sale order line the default product field is a required one. You may just make the original field hidden/invisible or even if you may remove that from the view.  Even though from the view you removed / hidden the field, it still remains as a required field.

As original  field , which is a required one, is not getting the value , you are getting this.

Thanks

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
مايو 25
5032
1
نوفمبر 24
845
1
مارس 23
1449
1
مارس 21
3018
1
يوليو 20
3176