我在sale.order模型中有一些自定义字段:
drupal_order_name = fields.Char('Drupal order name', index=True, readonly=True)
drupal_total = fields.Float('Drupal total', digits_compute= dp.get_precision('Product Price'), help="Total amount from Drupal. Compare this with the total provided by the ERP.", readonly=True)
payment_method = fields.Selection([
('bank_transfer', 'Bank transference'),
('commerce_cod', 'Bank debit'),
('commerce_stripe', 'Credit/Debit card'),
('pagamastarde', 'Funded payment'),
('paypal_wps', 'PayPal'),
], string='Payment method', index=True, readonly=False)
client_notes = fields.Text('Client notes')
ship_addr_name = fields.Char('Name (shipment)')
ship_addr_phone = fields.Char('Phone number (shipment)')
ship_addr_street = fields.Char('Street (shipment)')
ship_addr_zip = fields.Char('Zip Code (shipment)', index=True)
ship_addr_city = fields.Char('City (shipment)', index=True)
ship_addr_state = fields.Char('State (shipment)', index=True)
ship_addr_country = fields.Char('Country (shipment)', index=True)
ship_addr_extra_info = fields.Char('Extra info (shipment)', index=True)
我无法理解为什么ship_addr_ *和client_notes可导入(我可以在列选项中选择它们以从CSV导入向导导入值),并且drupal_order_name,drupal_total和payment_method不能选择作为字段以与CSV列匹配。
我做错了什么?我错过了任何配置吗?
类似的情况我从(OpenERP7)sale.order州域输出。我无法选择它来导出数据。
答案 0 :(得分:0)
如果我们使用 readonly = True 属性声明字段,则字段值不会存储在数据库中。
要避免此类问题,请从字段 drupal_order_name,drupal_total和payment_method 中删除 readonly = True 属性。
然后重新启动Odoo服务器并升级您的自定义模块。