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

I want to change the sequence in the delivery movements based on the location field. When the location changes or the products are returned, the movement sequence changes and takes the location code and changes it instead of wh 

But the following code shows Erro


class Stockpicking(models.Model): 

   _inherit = 'stock.picking'

   

 name = fields.Char(        'Reference', default='/',        copy=False, index='trigram', readonly=True, compute='_get_sequence')    


   location_dest_id = fields.Many2one(        'stock.location', "Destination Location",        compute="_compute_location_id", store=True, precompute=True, readonly=False,        check_company=True, required=True,        states={'done': [('readonly', True)]})



  @api.onchange('location_dest_id')   

 def _get_sequence(self):      

  self.name += self.name.location_dest_id

 

อวตาร
ละทิ้ง

Please post the error message.

ผู้เขียน

The field not change when return location still the same name

ผู้เขียน

The field not change when return location still the same name
Use on change function and create function but not change name