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

I'm having problems trying to duplicate a product that already exists, what I wanted was to click on a button and it would run a function to duplicate the article that is being represented on the page with all the attributes of the old product. If anyone has any suggestions I would appreciate it.


My attempt:

def action_create_custom_product(self):
    new_product = self.env['product.template'].copy(
        self.article_id.id, 
        default={
            'name': self.article_id.name,
            'list_price': self.production_price()
        }
    )

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
2
أكتوبر 22
2732
2
أغسطس 23
4144
0
أكتوبر 21
1725
1
سبتمبر 19
5150
1
يونيو 25
781