From 95daa34f629e8b0a307db76fba0cb95f9f085d9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 2 Jan 2016 10:26:12 +0100 Subject: [PATCH] Register Product and define principal property issue5087 --- __init__.py | 1 + product.py | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/__init__.py b/__init__.py index 009383c42f..6d60a3714e 100644 --- a/__init__.py +++ b/__init__.py @@ -21,6 +21,7 @@ def register(): SaleLine, Template, Template_Agent, + Product, module='commission', type_='model') Pool.register( CreateInvoice, diff --git a/product.py b/product.py index 3c630a018b..72f3efbfb7 100644 --- a/product.py +++ b/product.py @@ -6,7 +6,7 @@ from trytond.pool import PoolMeta from trytond.model import ModelSQL, fields -__all__ = ['Template', 'Template_Agent'] +__all__ = ['Template', 'Template_Agent', 'Product'] __metaclass__ = PoolMeta @@ -34,3 +34,11 @@ class Template_Agent(ModelSQL): domain=[ ('type_', '=', 'principal'), ]) + + +class Product: + __name__ = 'product.product' + + @property + def principal(self): + return self.template.principal