changeset 0edab7b3010a in modules/sale_opportunity:default
details: 
https://hg.tryton.org/modules/sale_opportunity?cmd=changeset;node=0edab7b3010a
description:
        Add contact and invoice party

        issue8992
        review274701003
diffstat:

 CHANGELOG                 |   2 ++
 doc/index.rst             |   1 +
 opportunity.py            |   7 +++++++
 view/opportunity_form.xml |  23 +++++++++++++++--------
 4 files changed, 25 insertions(+), 8 deletions(-)

diffs (96 lines):

diff -r 2ef24b5e214c -r 0edab7b3010a CHANGELOG
--- a/CHANGELOG Thu Mar 19 19:11:16 2020 +0100
+++ b/CHANGELOG Sat Mar 28 14:25:57 2020 +0100
@@ -1,3 +1,5 @@
+* Add contact on opportunity
+
 Version 5.4.0 - 2019-11-04
 * Bug fixes (see mercurial logs for details)
 * Use ir.calendar.month in report
diff -r 2ef24b5e214c -r 0edab7b3010a doc/index.rst
--- a/doc/index.rst     Thu Mar 19 19:11:16 2020 +0100
+++ b/doc/index.rst     Sat Mar 28 14:25:57 2020 +0100
@@ -11,6 +11,7 @@
 extensive list of the fields, most of them are optional:
 
 - Party: The customer.
+- Contact: The contact who placed the order.
 - Address: The main address of the customer.
 - Description: The description of the lead/opportunity.
 - Number: The internal reference of the lead/opportunity (will be generated
diff -r 2ef24b5e214c -r 0edab7b3010a opportunity.py
--- a/opportunity.py    Thu Mar 19 19:11:16 2020 +0100
+++ b/opportunity.py    Sat Mar 28 14:25:57 2020 +0100
@@ -40,6 +40,12 @@
             'readonly': Eval('state').in_(['converted', 'lost', 'cancelled']),
             'required': ~Eval('state').in_(['lead', 'lost', 'cancelled']),
             }, depends=['state'])
+    contact = fields.Many2One(
+        'party.contact_mechanism', "Contact",
+        search_context={
+            'related_party': Eval('party'),
+            },
+        depends=['party'])
     address = fields.Many2One('party.address', 'Address',
         domain=[('party', '=', Eval('party'))],
         select=True, depends=['party', 'state'],
@@ -283,6 +289,7 @@
         return Sale(
             description=self.description,
             party=self.party,
+            contact=self.contact,
             payment_term=self.payment_term,
             company=self.company,
             invoice_address=self.address,
diff -r 2ef24b5e214c -r 0edab7b3010a view/opportunity_form.xml
--- a/view/opportunity_form.xml Thu Mar 19 19:11:16 2020 +0100
+++ b/view/opportunity_form.xml Sat Mar 28 14:25:57 2020 +0100
@@ -1,17 +1,23 @@
 <?xml version="1.0"?>
 <!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
 this repository contains the full copyright notices and license terms. -->
-<form cursor="party">
-    <label name="reference"/>
-    <field name="reference"/>
+<form col="6">
+    <label name="party"/>
+    <field name="party"/>
+    <label name="contact"/>
+    <field name="contact"/>
     <label name="number"/>
     <field name="number"/>
-    <label name="party"/>
-    <field name="party"/>
+
     <label name="address"/>
-    <field name="address"/>
+    <field name="address" colspan="3"/>
+    <newline/>
+
     <label name="description"/>
     <field name="description" colspan="3"/>
+    <label name="reference"/>
+    <field name="reference"/>
+
     <label name="amount"/>
     <group col="2" id="amount_currency">
         <field name="amount"/>
@@ -23,7 +29,8 @@
         <label name="conversion_probability" string="%"
             xalign="0.0" xexpand="1"/>
     </group>
-    <notebook colspan="4">
+
+    <notebook colspan="6">
         <page string="Lead/Opportunity" id="opportunity">
             <label name="company"/>
             <field name="company"/>
@@ -49,7 +56,7 @@
     </notebook>
     <label name="state"/>
     <field name="state"/>
-    <group col="-1" colspan="2" id="buttons">
+    <group col="-1" colspan="4" id="buttons">
         <button name="cancel" icon="tryton-cancel"/>
         <button name="lost" icon="tryton-cancel"/>
         <button name="lead" icon="tryton-back"/>

Reply via email to