1👍
✅
Template access
From the product:
{{ some_product.ncm }}
From the SaleDetail:
{{ some_sale_detail.product.ncm }}
Python access
From the product:
class Product(models.Model):
def get_ncm(self):
return self.ncm
From the SaleDetail:
class SaleDetail(models.Model):
def get_ncm(self):
return self.product.ncm
Source:stackexchange.com