odoo - 如何在数据库中保存 qty_available 以便在每个产品 pos odoo 上显示它?
问题描述
我想为每个产品在数据库中的 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 模块中可用以使用它?
解决方案
推荐阅读
- angular - Angular Elements:即使是空的也会出现插槽
- python - TextInput 裁剪
- php - Firefox 将文件扩展名更改为“.csv.htm”。从 myapp (php/phpexcel) 下载 csv 时
- java - HIbernate突然开始验证JPA注解
- javascript - React-nvd3 在折线图上显示多条线
- css - Cloudflare 指向我的网站,但 Css 无法正常工作
- sap-cloud-platform - 在 SAP Cloud Foundry 应用程序中捕获会话超时
- typescript - 函数签名中的泛型类型
- r - 当您从变量中提取与 NA 不同的变量时,如何在 R 中的函数 range() 中包含小数位
- php - Laravel Prequel 配置成功,但打开时出现端口错误