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

I am working in the module stock_barcode

I try to edit the product_selector on case Confirm button


First I try this code to change the confirm button like this

====================================================

             

XML CODE 

       

            stock.move.line.product.selector.inherit

            stock.move.line

           

           

               

                   

               

           

       


=====================================================
and I add python code code 

======================================================
class StockMoveLine(models.Model):

    _inherit = 'stock.move.line'



   def write(self, vals):

        

        return super(StockMoveLine, self).write(vals)


    def custom_save_method(self):

        // Code here 

        return _self.write({})
======================================================

when I try to press confirm button It will going to the write function

before It going to the custom_save_method function


so I can't write my code in custom_save_method method because I want to make case to stop saving the data

and when I try to write code in "write" method , It will applied any where with the model 'stock.move.line'


how can I make the code know if the confirm order came from the product_selector view or not


Please any one help me in this issue

อวตาร
ละทิ้ง
ผู้เขียน

why I can't add, XML code, and I can't add, Image, I think there's an error in this forums

Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ธ.ค. 24
2636
how can I know the current view id? แก้ไขแล้ว
1
ก.ย. 24
1549
0
พ.ค. 24
1533
1
พ.ค. 25
1088
Prevent Lead/CRM Duplicates แก้ไขแล้ว
3
พ.ค. 25
766