【发布时间】:2014-06-01 16:55:34
【问题描述】:
我是 Openerp 的新手。我正在根据要求对其进行自定义。我有以下问题:
问题 1: 我介绍了产品的新状态。 “待定”、“已确认”、“已取消”。现在的问题是,只有“采购经理”才能编辑已确认的产品。普通用户只能编辑“待定产品”。
问题 2: 管理员用户只能确认产品。我已经实现了这一点。但我需要做一些验证。在确认产品之前,“供应商”和“单价”是必填项。如果没有添加,则需要显示警告信息。
我正在尝试通过自定义(访问权限等)来实现这些。但没有运气。
编辑1:
from osv import fields, osv
class purchase_order(osv.osv):
_inherit = 'product.product'
_columns = {
'stage': fields.selection([
('pending', 'Pending'),
('confirmed', 'Confirmed'),
('cancel', 'Cancelled'),
], 'Status', select=True, track_visibility='onchange', help='Product Workflow Stages')
}
_defaults = {
'type' : 'consu',
'stage': 'pending',
}
purchase_order()
通过 UI 进行自定义:
任何帮助都可以节省我的工作时间。
【问题讨论】: