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

Hi,

I have the field in product.packaging called remaining_quantities and quantities .i already added product field to that.

class ProductPackaging(models.Model):

_inherit = 'product.packaging'

add_quantities = fields.Float(string="Quntities" ,compute='_compute_unit_carton')
products = fields.Many2one('product.product',string="Product Name",default=_default_products)
and there is another field in stock.quant.package called remaining_quantity
class PackingCalculations(models.Model):
_inherit = 'stock.quant.package'

remaining_quantity= fields.Float(string="Remaning Quantity")

When I'm updating the add_quantities field remaining quantity will be minus with qty_done field value in stock.move.line.

Ex - qty_done - add_quantities = remaining_quantity

Please help me if you have any idea about this. 

อวตาร
ละทิ้ง

make one more field in product.packaging field name can be remaining_quantity

after that you can calculate your remaining_quantity and make related field with stock.quant.package

its always auto update when you change add_quantities field in add_quantities

Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ก.พ. 24
15608
1
ธ.ค. 22
5041
2
ธ.ค. 22
14537
2
มิ.ย. 22
6406
2
มิ.ย. 22
4770