How to update/edit the Stock_partial_picking module/pluggin

Asked by John Chen


I want to change the content of stock_partial_picking using import method (.py)
i would like to hidden or delete the "cost" and "currency" fields in the menu so that user won't be able to see the cost when receiving product in incoming shipment.

Note: Cost only appear in average price mode (when we edited the product from standard price to average price.)

My Code :
# -*- encoding: utf-8 -*-
from osv import osv, fields
import os

class stock_partial_picking(osv.osv):
    _name = "stock.partial.picking"

    def __create_partial_picking_memory(self, picking, pick_type):
        move_memory = {
            'product_id' :,
            'quantity' : picking.product_qty,
            'product_uom' :,
            'prodlot_id' :,
            'move_id' :,

        if pick_type == 'in':
                'cost' : picking.product_id.standard_price, <------- delete / hidden
                'currency' :, <------- delete / hidden
        return move_memory

i use this method in other place it worked fine but using for this stock_partial_picking is not working well.

Question information

English Edit question
Odoo Web Client Edit question
No assignee Edit question
Solved by:
John Chen
Last query:
Last reply:
Revision history for this message
OpenBMS JSC (openbmsjsc) said :

Isn't it better to hide the field in the views (XML files) using ACL to a certain group. That's way you can restrict people to view certain field, and do not have to code.

Revision history for this message
John Chen (john-chen2011) said :

Thanks Mr. Phong Nguyen-Thanh

I solved the problems already by adding position="replace" and invisible="1" in cost and currency fields XML.