Odoo Help


Getting customer name in stock.production.lot

on 9/7/16, 4:13 AM 648 views

hi all,

I have activated track serial number option and purchased a product by adding a serial number to that products.

Now i sold one product to a customer. I can see all the details of a particular product in stock.move like product name, source location, destination location etc. 

But i cant see much information in stock.production.lot(Serial Number/Lots) menu. There we can see only Serial Number, product and One2many table stock.quant. 

My requirement is: When i sale the particular Product to a Customer. His name should be printed with that product name in stock.production.lot(Serial Number/Lots). How can we get that name from sale.order to stock.production.lot

I tried below code.


class WMSStockProductionLot(models.Model):
_inherit = "stock.production.lot"
_description = "WMS Stock Production Lot is used too call customer name"
def get_customer(self):
res = self.env['stock.move'].search([], limit=[])
_logger.info("asdadasdasd %s",res)
for a in res:
return res
partner_id = fields.Many2one('res.partner',compute="get_customer", string='Customer')


<record id="view_stock_production_form_inherite" model="ir.ui.view">
<field name="name">Stock Production Lot</field>
<field name="model">stock.production.lot</field>
<field name="inherit_id" ref="stock.view_production_lot_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='ref']" position="after">
<field name="partner_id"/>

i am getting customer name but it will be written for all the products in (Serial Number/Lots)

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 9/7/16, 4:13 AM
Seen: 648 times
Last updated: 9/7/16, 4:16 AM