copy
This commit is contained in:
parent
b5e3a4eaf0
commit
a32cd7f05f
|
@ -37,6 +37,7 @@ def register():
|
|||
opportunity.OpportunityKind,
|
||||
opportunity.OpportunityKindConcept,
|
||||
opportunity.OpportunityCancelledReason,
|
||||
|
||||
# opportunity.PartyEvaluationConcept,
|
||||
# opportunity.PartyEvaluation,
|
||||
# party_validation.Validation,
|
||||
|
@ -44,6 +45,7 @@ def register():
|
|||
party_validation.ValidationTemplate,
|
||||
party_validation.ValidationTemplateAsk,
|
||||
party_validation.ValidationAsk,
|
||||
party_validation.ValidationHistoryAsk,
|
||||
contract.Contract,
|
||||
# opportunity.OpportunityEmployee,
|
||||
# opportunity.OpportunityEmployeeContext,
|
||||
|
|
26
locale/es.po
26
locale/es.po
|
@ -262,7 +262,6 @@ msgctxt "field:crm.opportunity,amount:"
|
|||
msgid "Amount"
|
||||
msgstr "Valor Estimado"
|
||||
|
||||
#, fuzzy
|
||||
msgctxt "field:crm.opportunity,cancelled_reason:"
|
||||
msgid "Cancelled Reason Concept"
|
||||
msgstr "Motivo de la Anulación"
|
||||
|
@ -319,6 +318,7 @@ msgctxt "field:crm.opportunity,is_prospect:"
|
|||
msgid "Is Prospect"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy
|
||||
msgctxt "field:crm.opportunity,kind_opportunity:"
|
||||
msgid "Kind Opportunity"
|
||||
msgstr "Tipo de Oportunidad "
|
||||
|
@ -376,6 +376,11 @@ msgctxt "field:crm.opportunity,total:"
|
|||
msgid "Total"
|
||||
msgstr " Total Linea"
|
||||
|
||||
#, fuzzy
|
||||
msgctxt "field:crm.opportunity,total_without_tax:"
|
||||
msgid "Total"
|
||||
msgstr " Total Linea"
|
||||
|
||||
msgctxt "field:crm.opportunity,traceability:"
|
||||
msgid "Opportunity Traceability"
|
||||
msgstr "Trazabilidad"
|
||||
|
@ -392,6 +397,10 @@ msgctxt "field:crm.opportunity.kind,opportunity:"
|
|||
msgid "Opportunity"
|
||||
msgstr "Oportunidad"
|
||||
|
||||
msgctxt "field:crm.opportunity.line,base_tax:"
|
||||
msgid "Base Tax"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "field:crm.opportunity.line,description:"
|
||||
msgid "Description"
|
||||
msgstr "Descripción"
|
||||
|
@ -412,10 +421,20 @@ msgctxt "field:crm.opportunity.line,quantity:"
|
|||
msgid "Quantity"
|
||||
msgstr "Cantidad"
|
||||
|
||||
#, fuzzy
|
||||
msgctxt "field:crm.opportunity.line,tax:"
|
||||
msgid "Tax Line"
|
||||
msgstr "Línea de impuesto"
|
||||
|
||||
msgctxt "field:crm.opportunity.line,total_line:"
|
||||
msgid "Total Line"
|
||||
msgstr "Total Linea"
|
||||
|
||||
#, fuzzy
|
||||
msgctxt "field:crm.opportunity.line,total_line_with_tax:"
|
||||
msgid "Total Line"
|
||||
msgstr "Total Linea"
|
||||
|
||||
msgctxt "field:crm.opportunity.line,unit:"
|
||||
msgid "Unit"
|
||||
msgstr "Unidad"
|
||||
|
@ -661,6 +680,11 @@ msgctxt "field:party.party,party_validations:"
|
|||
msgid "Party Validations"
|
||||
msgstr "Validación Terceros"
|
||||
|
||||
#, fuzzy
|
||||
msgctxt "field:sale.contract,department:"
|
||||
msgid "Department"
|
||||
msgstr "Departamento"
|
||||
|
||||
msgctxt "help:crm.opportunity,amount:"
|
||||
msgid "Estimated revenue amount."
|
||||
msgstr ""
|
||||
|
|
|
@ -247,7 +247,7 @@ class Opportunity(
|
|||
party_validations = fields.One2Many('crm.opportunity.validation', 'opportunity', 'Party Validations')
|
||||
is_prospect = fields.Function(fields.Boolean('Is Prospect'), 'get_is_prospect')
|
||||
is_approved = fields.Function(fields.Boolean('Is Approved'), 'get_is_approved')
|
||||
traceability = fields.One2Many('crm.opportunity_traceability', 'opportunity', 'Opportunity Traceability')
|
||||
traceability = fields.One2Many('crm.opportunity_traceability', 'opportunity', 'Opportunity Traceability', readonly=False)
|
||||
# del _states_start, _depends_start
|
||||
# del _states_stop, _depends_stop
|
||||
|
||||
|
@ -282,7 +282,7 @@ class Opportunity(
|
|||
('accepted', 'customer_approbation'),
|
||||
('cancelled', 'prospecting'),
|
||||
('lost', 'quote_approbation'),
|
||||
('lost', 'customer_approbation'),
|
||||
('lost', 'cancelled'),
|
||||
))
|
||||
cls._buttons.update({
|
||||
'prospecting': {
|
||||
|
@ -310,7 +310,7 @@ class Opportunity(
|
|||
'tryton-back', 'tryton-forward'),
|
||||
},
|
||||
'quote_approbation': {
|
||||
'invisible': ~Eval('state').in_(['quotation', 'quote_revision']),
|
||||
'invisible': ~Eval('state').in_(['quotation', 'quote_revision','lost']),
|
||||
'icon': If(Eval('state').in_([ 'quote_revision']),
|
||||
'tryton-back', 'tryton-forward'),
|
||||
},
|
||||
|
@ -320,12 +320,12 @@ class Opportunity(
|
|||
'tryton-back', 'tryton-forward'),
|
||||
},
|
||||
'customer_approbation': {
|
||||
'invisible': ~Eval('state').in_(['quote_approbation','accepted', 'lost']),
|
||||
'invisible': ~Eval('state').in_(['quote_approbation','accepted']),
|
||||
'icon': If(Eval('state').in_(['quote_approbation']),
|
||||
'tryton-forward', 'tryton-back'),
|
||||
},
|
||||
'accepted': {
|
||||
'invisible': ~Eval('state').in_(['customer_approbation', 'lost']),
|
||||
'invisible': ~Eval('state').in_(['customer_approbation']),
|
||||
'icon': If(Eval('state').in_(['customer_approbation']),
|
||||
'tryton-create', 'tryton-back'),
|
||||
},
|
||||
|
@ -333,7 +333,7 @@ class Opportunity(
|
|||
'invisible': ~Eval('state').in_(['customer_approbation']),
|
||||
},
|
||||
'cancelled': {
|
||||
'invisible': ~Eval('state').in_(['analysis', 'quote_revision','review']),
|
||||
'invisible': ~Eval('state').in_(['analysis', 'quote_revision','review','lost']),
|
||||
},
|
||||
})
|
||||
|
||||
|
@ -791,7 +791,8 @@ class Opportunity(
|
|||
@Workflow.transition('lost')
|
||||
def lost(cls, records):
|
||||
Date = Pool().get('ir.date')
|
||||
cls.write([o for o in records if o.is_forecast], {
|
||||
# if o.is_forecast
|
||||
cls.write([o for o in records], {
|
||||
'end_date': Date.today(),
|
||||
'state': 'lost',
|
||||
})
|
||||
|
|
|
@ -4,7 +4,7 @@ from datetime import datetime, date
|
|||
from trytond.report import Report
|
||||
from trytond.model import ModelView, ModelSQL, fields, Workflow
|
||||
from trytond.pyson import Eval, If, In, Get
|
||||
from trytond.pool import Pool
|
||||
from trytond.pool import Pool, PoolMeta
|
||||
from trytond.transaction import Transaction
|
||||
from .exceptions import CrmConfigurationError
|
||||
from trytond.i18n import gettext
|
||||
|
@ -38,6 +38,7 @@ class ValidationTemplateAsk(ModelSQL, ModelView):
|
|||
class ValidationAsk(ModelSQL, ModelView):
|
||||
"Validation Ask"
|
||||
__name__ = "crm.opportunity.validation"
|
||||
_history = True
|
||||
opportunity = fields.Many2One('crm.opportunity',
|
||||
'Opportunity', required=True)
|
||||
party = fields.Many2One('party.party',
|
||||
|
@ -73,5 +74,30 @@ class ValidationAsk(ModelSQL, ModelView):
|
|||
if self.response:
|
||||
self.validated_by = Transaction().user
|
||||
self.date_validation = date.today()
|
||||
# print(self.__table_history__,'Historia')
|
||||
else:
|
||||
self.date_validation = None
|
||||
|
||||
class ValidationHistoryAsk(ModelView, metaclass=PoolMeta):
|
||||
"Validation History Ask"
|
||||
__name__ = "crm.opportunity.validation._history"
|
||||
line_ask = fields.Char('Ask', required=True, select=True)
|
||||
# response = fields.Boolean('Response')
|
||||
# sort=False, readonly=True
|
||||
comment = fields.Text('Comments')
|
||||
validated_by = fields.Many2One('res.user', 'User')
|
||||
|
||||
|
||||
|
||||
class PartyValidationTraceability(ModelSQL, ModelView):
|
||||
''' Model to save traceability of the Party Validation'''
|
||||
'Party Validation Traceability'
|
||||
__name__ = 'crm.party_validation_traceability'
|
||||
response = fields.Selection([
|
||||
("", ""),
|
||||
('approved', 'Approved'),
|
||||
('rejected', 'Rejected'),
|
||||
], "Response")
|
||||
opportunity = fields.Many2One('crm.opportunity', 'Opportunity', required=True )
|
||||
comment = fields.Text('Comments')
|
||||
validated_by = fields.Many2One('res.user', 'User')
|
||||
|
|
|
@ -15,6 +15,18 @@ this repository contains the full copyright notices and license terms. -->
|
|||
<field name="name">opportunity_validation_form</field>
|
||||
</record>
|
||||
|
||||
<!-- <record model="ir.ui.view" id="opportunity_validation_history_view_tree">
|
||||
<field name="model">crm.opportunity.validation.danny</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="name">opportunity_validation_history_tree</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="opportunity_validation_history_view_form">
|
||||
<field name="model">crm.opportunity.validation.danny</field>
|
||||
<field name="type">form</field>
|
||||
<field name="name">opportunity_validation_history_form</field>
|
||||
</record> -->
|
||||
|
||||
<!-- <record model="ir.ui.view" id="validation_view_tree">
|
||||
<field name="model">crm.validation</field>
|
||||
<field name="type">tree</field>
|
||||
|
@ -83,6 +95,53 @@ this repository contains the full copyright notices and license terms. -->
|
|||
<menuitem parent="party.menu_party_configuration" sequence="100"
|
||||
action="act_validation_template_tree" string="Validation Template" id="menu_validation_template_tree"/>
|
||||
|
||||
<!-- <record model="ir.model.access" id="access_crm_opportunity">
|
||||
<field name="model" search="[('model', '=', 'crm.opportunity.validation._history')]"/>
|
||||
<field name="perm_read" eval="False"/>
|
||||
<field name="perm_write" eval="False"/>
|
||||
<field name="perm_create" eval="False"/>
|
||||
<field name="perm_delete" eval="False"/>
|
||||
</record>
|
||||
<record model="ir.model.access" id="access_crm_opportunity_sale">
|
||||
<field name="model" search="[('model', '=', 'crm.opportunity')]"/>
|
||||
<field name="group" ref="sale.group_sale"/>
|
||||
<field name="perm_read" eval="True"/>
|
||||
<field name="perm_write" eval="False"/>
|
||||
<field name="perm_create" eval="False"/>
|
||||
<field name="perm_delete" eval="False"/>
|
||||
</record> -->
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="validation_history_view_tree">
|
||||
<field name="model">crm.opportunity.validation._history</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="priority">10</field>
|
||||
<field name="name">validation_history_tree</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="validation_history_view_form">
|
||||
<field name="model">crm.opportunity.validation._history</field>
|
||||
<field name="type">form</field>
|
||||
<field name="name">validation_history_form</field>
|
||||
</record>
|
||||
<record model="ir.action.act_window" id="act_validation_history_tree">
|
||||
<field name="name">Validation Hystory</field>
|
||||
<field name="res_model">crm.opportunity.validation._history</field>
|
||||
</record>
|
||||
<record model="ir.action.act_window.view" id="act_validation_history_tree_view1">
|
||||
<field name="sequence" eval="1"/>
|
||||
<field name="view" ref="validation_history_view_tree"/>
|
||||
<field name="act_window" ref="act_validation_history_tree"/>
|
||||
</record>
|
||||
<record model="ir.action.act_window.view" id="act_validation_history_tree_view2">
|
||||
<field name="sequence" eval="2"/>
|
||||
<field name="view" ref="validation_history_view_form"/>
|
||||
<field name="act_window" ref="act_validation_history_tree"/>
|
||||
</record>
|
||||
<menuitem parent="party.menu_party_configuration" sequence="100"
|
||||
action="act_validation_history_tree" id="menu_validation_history_tree"/>
|
||||
|
||||
|
||||
|
||||
<!-- <record model="ir.model.access" id="access_crm_validation_template">
|
||||
<field name="model" search="[('model', '=', 'crm.validation_template')]"/>
|
||||
<field name="perm_read" eval="True"/>
|
||||
|
|
|
@ -61,12 +61,18 @@ this repository contains the full copyright notices and license terms. -->
|
|||
<page string="Party Validation" name="party_validations">
|
||||
<field name="party_validations" view_ids="crm.opportunity_validation_view_tree,crm.opportunity_validation_view_form" colspan="4"/>
|
||||
</page>
|
||||
|
||||
|
||||
|
||||
<page string="Contracts" name="contracts">
|
||||
<field name="contracts" colspan="4"/>
|
||||
</page>
|
||||
<page name="sales">
|
||||
<field name="sales" colspan="4"/>
|
||||
</page>
|
||||
<page name="traceability">
|
||||
<field name="traceability" colspan="4"/>
|
||||
</page>
|
||||
|
||||
</notebook>
|
||||
<label name="state"/>
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
<?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 col="6">
|
||||
<!-- <label name="id"/>
|
||||
<field name="id"/>
|
||||
<label name="action"/>
|
||||
<field name="action"/> -->
|
||||
|
||||
</form>
|
|
@ -0,0 +1,11 @@
|
|||
<?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. -->
|
||||
<tree>
|
||||
<field name="create_date" widget="date"/>
|
||||
<!-- <field name="create_date" widget="time"/> -->
|
||||
|
||||
<field name="action" expand="1"/>
|
||||
<field name="validated_by" expand="1"/>
|
||||
<!-- <field name="observation" expand="1"/> -->
|
||||
</tree>
|
|
@ -1,18 +0,0 @@
|
|||
<?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. -->
|
||||
<tree>
|
||||
<field name="number" expand="1"/>
|
||||
<field name="reference" expand="1"/>
|
||||
<field name="source" expand="1"/>
|
||||
<field name="start_date"/>
|
||||
<field name="end_date"/>
|
||||
<field name="employee" expand="1"/>
|
||||
<field name="description" expand="1"/>
|
||||
<field name="party" expand="1"/>
|
||||
<field name="amount" symbol="currency"/>
|
||||
<field name="state"/>
|
||||
<field name="conversion_probability" factor="100">
|
||||
<suffix name="conversion_probability" string="%"/>
|
||||
</field>
|
||||
</tree>
|
|
@ -13,4 +13,6 @@ this repository contains the full copyright notices and license terms. -->
|
|||
<separator name="comment" colspan="4"/>
|
||||
<field name="comment" colspan="4"/>
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
|
|
|
@ -10,5 +10,6 @@ this repository contains the full copyright notices and license terms. -->
|
|||
<field name="comment" />
|
||||
<field name="validated_by" />
|
||||
<field name="date_validation" />
|
||||
<!-- <field name="__table_history__" /> -->
|
||||
|
||||
</tree>
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
<?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>
|
||||
<label name="line_ask"/>
|
||||
<field name="line_ask"/>
|
||||
<label name="validated_by"/>
|
||||
<field name="validated_by"/>
|
||||
</form>
|
|
@ -0,0 +1,10 @@
|
|||
<?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. -->
|
||||
<tree>
|
||||
<!-- <field name="create_date" widget="date"/> -->
|
||||
<!-- <field name="create_date" widget="time"/> -->
|
||||
<field name="line_ask"/>
|
||||
<field name="validated_by"/>
|
||||
<!-- <field name="comment"/> -->
|
||||
</tree>
|
Loading…
Reference in New Issue