Odoo 10 - Create a record in product.uom via data/…xml

此生再无相见时 提交于 2020-01-07 04:38:12

问题


I have to use the following custom UoM defined in the system:

 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

Could someone provide an example on how to create it?


回答1:


There are two ways insert a new UoM :

  1. Using xml file :

    Go to 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>

Or using .csv file :

  1. Go to settings/configuration/warehouse, and check the 5th option in Location & Warehouse, Manage different units of measure for products
  2. Go to warehouse/configuration/unite of mesure, in tree view export the data, then you can add a new UoM to this file



来源:https://stackoverflow.com/questions/45075701/odoo-10-create-a-record-in-product-uom-via-data-xml

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!