コンテンツへスキップ
メニュー
この質問にフラグが付けられました
3370 ビュー

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

アバター
破棄
関連投稿 返信 ビュー 活動
1
8月 22
4030
2
8月 25
595
0
7月 25
486
1
7月 25
917
1
7月 25
1324