1
我使用的是openerp 6.1.Here在pos模塊中沒有選擇客戶的功能。我想添加這個字段。但我不能。任何人都可以幫我嗎?在openerp pos模塊中添加客戶字段
我使用的是openerp 6.1.Here在pos模塊中沒有選擇客戶的功能。我想添加這個字段。但我不能。任何人都可以幫我嗎?在openerp pos模塊中添加客戶字段
您可以通過在自定義模塊中繼承任何模型來添加額外字段。
您必須繼承「pos.order」對象&視圖。
繼承你的.py 'pos.order':
class pos_order(osv.osv):
_inherit = 'pos.order'
_columns = {
'customer_id': fields.many2one('res.partner', 'Customer'),
}
pos_order()
上面的代碼將在數據庫中創建一個字段。
現在,在表單中顯示的字段,在您的.xml繼承「pos.order」的視圖,:
<record id="inherited_form_pos_view" model="ir.ui.view">
<field name="name">pos.order.form.inherit</field>
<field name="model">pos.order</field>
<field name="type">form</field>
<field name="inherit_id" ref="point_of_sale.view_pos_pos_form"/>
<field name="arch" type="xml">
<field name="name" position="after">
<field name="customer_id"/>
</field>
</field>
</record>
現在,你可以在你的pos.order看到「客戶」領域形成。
感謝您的貢獻。根據你在openerp後臺添加字段。但我需要添加客戶在銷售點模塊,這是隻在瀏覽器中可見。這就是xml在/ addons/point_of_sale/static/src/xml /pos.xml.Frankly speaking我能夠添加一個名爲customer.But的按鈕,但我無法創建按鈕action.If可能plz幫助我..提前感謝 –
你真的想要做什麼?如果你想在視圖中顯示字段,你必須用xml編寫它。你能提供你的代碼或更多信息嗎? –
我認爲她想要有一個搜索按鈕過濾器。 Priyanka請求發光 –