Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ

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()
        }
    )

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ต.ค. 22
2711
2
ส.ค. 23
4132
0
ต.ค. 21
1721
1
ก.ย. 19
5146
1
มิ.ย. 25
768