This question has been flagged
2251 Views

I need somebody to help me getting variable "lot" in manufacturing


On my odoo system i have set traceability -> track lots or serial numbers so that when i produce something in manufacturing i will be able to enter lot number


i have been writing a function to get name and lot number that it is enter at that time

however, i am facing a problem that i cant get lot number that being entered. but i was able to get product name and quantity that is being produce

i need help to get lot product. can somebody shed me a light on these

here is my part of code

class productprint(models.Model):

 _inherit = 'mrp.production'

def productlabel(self):

url = 'xxx'

  headers = {'Content-Type': 'application/json'}

data = {

    "Product Name": self.product_id.name,

    "Manufacture Date": "ShippingLabel.btw",

    "Quantity": self.product_qty,

    "Lot": (quant.lot_id.id, self.env['stock.quant']),

  }

  data_json = json.dumps(data)

  r = requests.post(url=url, data=data_json, headers=headers)

above code is what i am trying to gather data in manufacturing and send in json

Avatar
Discard