Odoo 10 - 通过 data/...xml 在 product.uom 中创建一条记录
Odoo 10 - Create a record in product.uom via data/...xml
我必须使用系统中定义的以下自定义 UoM:
id | create_uid | name | rounding | write_uid | uom_type | write_date | factor | active | create_date | category_id
----+------------+--------+----------+-----------+----------+----------------------------+--------+--------+----------------------------+-------------
20 | 1 | MILES | 0.001 | 1 | bigger | 2017-07-12 03:42:25.363007 | 0.001 | t | 2017-07-12 03:33:27.251635 | 1
有人可以提供有关如何创建它的示例吗?
插入新计量单位的方法有两种:
使用 xml 文件:
前往addons/product/product_data.xml
<record id="product_uom_unit" model="product.uom">
<field name="category_id" ref="product_uom_categ_unit"/>
<field name="name">Unit(s)</field>
<field name="factor" eval="1.0"/>
<field name="rounding" eval="0.001"/>
</record>
或使用 .csv 文件:
- 转到 settings/configuration/warehouse,并检查位置和仓库中的第 5 个选项,
Manage different units of measure for products
- 转到warehouse/configuration/unite的mesure,在树视图中导出数据,然后你可以向这个文件添加一个新的UoM
我必须使用系统中定义的以下自定义 UoM:
id | create_uid | name | rounding | write_uid | uom_type | write_date | factor | active | create_date | category_id
----+------------+--------+----------+-----------+----------+----------------------------+--------+--------+----------------------------+-------------
20 | 1 | MILES | 0.001 | 1 | bigger | 2017-07-12 03:42:25.363007 | 0.001 | t | 2017-07-12 03:33:27.251635 | 1
有人可以提供有关如何创建它的示例吗?
插入新计量单位的方法有两种:
使用 xml 文件:
前往addons/product/product_data.xml
<record id="product_uom_unit" model="product.uom">
<field name="category_id" ref="product_uom_categ_unit"/>
<field name="name">Unit(s)</field>
<field name="factor" eval="1.0"/>
<field name="rounding" eval="0.001"/>
</record>
或使用 .csv 文件:
- 转到 settings/configuration/warehouse,并检查位置和仓库中的第 5 个选项,
Manage different units of measure for products
- 转到warehouse/configuration/unite的mesure,在树视图中导出数据,然后你可以向这个文件添加一个新的UoM