Use commission product from agent's plan if defined

issue4834
review8191002
This commit is contained in:
Sergi Almacellas Abellana committed 2015-07-31 11:30:33 +02:00
1 parent bdaeb77284
commit 82b88c2a6a
1 file changed
+5
+5
View File
@@ -275,6 +275,11 @@ class Commission(ModelSQL, ModelView):
'principal': 'in',
}.get(self.agent.type_)
@fields.depends('agent', 'product')
def on_change_agent(self):
if not self.product and self.agent and self.agent.plan:
self.product = self.agent.plan.commission_product
def get_invoice_state(self, name):
state = ''
if self.invoice_line: