2

我想为每个产品在数据库中的 product_template 模型中保存可用数量(qty_available)字段。我怎样才能做到这一点?

我想在 pos 中显示每种产品的可用数量。所以我需要 qty_available 我该怎么做?

qty_available = fields.Float(
        'Quantity On Hand', compute='_compute_quantities', search='_search_qty_available',
        digits=dp.get_precision('Product Unit of Measure'),
        help="Current quantity of products.\n"
             "In a context with a single Stock Location, this includes "
             "goods stored at this Location, or any of its children.\n"
             "In a context with a single Warehouse, this includes "
             "goods stored in the Stock Location of this Warehouse, or any "
             "of its children.\n"
             "stored in the Stock Location of the Warehouse of this Shop, "
             "or any of its children.\n"
             "Otherwise, this includes goods stored in any Stock Location "
             "with 'internal' type.")

此字段在库存中定义。如何使其在 product_template 或 pos 模块中可用以使用它?

4

0 回答 0