如何在odoo中存储company_dependent字段?

时间:2018-05-04 05:07:12

标签: odoo-11

我想存储prodct.product表的 standard_price 字段,以便在sql查询中使用此字段值。

代码在这里:

# -*- coding: utf-8 -*-
from odoo import fields, models
from odoo.addons import decimal_precision as dp

    class Product(models.Model):
        _inherit = "product.product"

        standard_price = fields.Float(
            'Cost', company_dependent=True,
            digits=dp.get_precision('Product Price'),
            groups="base.group_user",store=True,
            help = "Cost used for stock valuation in standard price and as a first price to set in average/fifo. "
                   "Also used as a base price for pricelists. "
                   "Expressed in the default unit of measure of the product.")

0 个答案:

没有答案