Change design of report and update selection fields.

This commit is contained in:
Danny Barajas 2022-02-24 18:50:10 -05:00
parent 23662ea227
commit 5898a63d89
9 changed files with 61299 additions and 936 deletions

1
.~lock.opportunity.fodt# Normal file
View File

@ -0,0 +1 @@
,dannybarajas,danny-Notebook,24.02.2022 18:44,file:///home/dannybarajas/.config/libreoffice/4;

View File

@ -32,6 +32,8 @@ def register():
opportunity.CrmOpportunityLine,
opportunity.PartyValidationOpportunity,
opportunity.OpportunityTraceability,
opportunity.OpportunityKind,
opportunity.OpportunityKindConcept,
# opportunity.PartyEvaluationConcept,
# opportunity.PartyEvaluation,
# party_validation.Validation,

View File

@ -262,6 +262,10 @@ msgctxt "field:crm.opportunity,amount:"
msgid "Amount"
msgstr "Valor Estimado"
msgctxt "field:crm.opportunity,cancelled_reason:"
msgid "Cancelled Reason"
msgstr "Razón de la Anulación"
msgctxt "field:crm.opportunity,comment:"
msgid "Comment"
msgstr "Comentarios"
@ -314,6 +318,10 @@ msgctxt "field:crm.opportunity,is_prospect:"
msgid "Is Prospect"
msgstr ""
msgctxt "field:crm.opportunity,kind_opportunity:"
msgid "Opportunity Kind Concept"
msgstr "Clase"
msgctxt "field:crm.opportunity,lines:"
msgid "Lines"
msgstr "Líneas"
@ -364,12 +372,20 @@ msgstr "Frecuencia de Facturación"
msgctxt "field:crm.opportunity,traceability:"
msgid "Opportunity Traceability"
msgstr ""
msgstr "Trazabilidad"
msgctxt "field:crm.opportunity,type:"
msgid "Type"
msgstr "Tipo de Oportunidad"
msgctxt "field:crm.opportunity.kind,concept:"
msgid "Concept Opportunity Kind"
msgstr "Clase"
msgctxt "field:crm.opportunity.kind,opportunity:"
msgid "Opportunity"
msgstr "Oportunidad"
msgctxt "field:crm.opportunity.line,description:"
msgid "Description"
msgstr "Descripción"
@ -434,40 +450,37 @@ msgctxt "field:crm.opportunity.validation,template:"
msgid "Template Ask"
msgstr ""
#, fuzzy
msgctxt "field:crm.opportunity.validation,validated_by:"
msgid "User"
msgid "Validated By"
msgstr "Validado Por"
#, fuzzy
msgctxt "field:crm.opportunity_kind_concept,name:"
msgid "Concept Name"
msgstr "Concepto"
msgctxt "field:crm.opportunity_traceability,action:"
msgid "Action"
msgstr "Acción"
#, fuzzy
msgctxt "field:crm.opportunity_traceability,date:"
msgid "Date"
msgstr "Fecha Venta"
msgstr "Fecha"
#, fuzzy
msgctxt "field:crm.opportunity_traceability,date_action:"
msgid "Date"
msgstr "Fecha Venta"
msgstr "Fecha"
#, fuzzy
msgctxt "field:crm.opportunity_traceability,observation:"
msgid "Observation"
msgstr "Observación"
#, fuzzy
msgctxt "field:crm.opportunity_traceability,opportunity:"
msgid "Opportunity"
msgstr "Oporunidad"
msgstr "Oportunidad"
#, fuzzy
msgctxt "field:crm.opportunity_traceability,validated_by:"
msgid "User"
msgstr "Validado Por"
msgstr "Usuario"
msgctxt "field:crm.party_validation_opportunity,approved:"
msgid "Approved"
@ -669,6 +682,10 @@ msgctxt "model:crm.opportunity,name:"
msgid "CRM Opportunity"
msgstr "CRM Oportunidad"
msgctxt "model:crm.opportunity.kind,name:"
msgid "Opportunity Kind"
msgstr "Clase"
msgctxt "model:crm.opportunity.line,name:"
msgid "CRM Opportunity Line"
msgstr "Linea Oportunidad"
@ -677,6 +694,10 @@ msgctxt "model:crm.opportunity.validation,name:"
msgid "Validation Ask"
msgstr "Linea de Validación"
msgctxt "model:crm.opportunity_kind_concept,name:"
msgid "Opportunity Kind Concept"
msgstr "Clase"
msgctxt "model:crm.opportunity_traceability,name:"
msgid "Model to save traceability of the opportunity"
msgstr ""
@ -2119,6 +2140,14 @@ msgctxt "selection:crm.customer_service,victim_of_violence:"
msgid "Yes"
msgstr "Si"
msgctxt "selection:crm.opportunity,cancelled_reason:"
msgid "No rentable para la empresa"
msgstr ""
msgctxt "selection:crm.opportunity,cancelled_reason:"
msgid "No se llego a un acuerdo"
msgstr ""
msgctxt "selection:crm.opportunity,reference:"
msgid "Electronic"
msgstr ""

31042
opportunity (copy).fodt Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -64,17 +64,20 @@ class Opportunity(
_depends_stop = ['state']
number = fields.Char('Number', readonly=True, required=True, select=True)
# reference = fields.Char('Reference', select=True,
# states={
# 'readonly': ~Eval('state').in_(['prospecting', 'analysis', 'quote_revision', 'review'])
# })
reference = fields.Selection([
('physical', "Physical"),
('electronic', "Electronic")], "Reference", select=True, sort=False,
reference = fields.Char('Reference', select=True,
states={
'readonly': ~Eval('state').in_(['prospecting', 'analysis'])
'readonly': ~Eval('state').in_(['prospecting', 'analysis', 'quote_revision', 'review'])
})
kind_opportunity = fields.Many2One('crm.opportunity_kind_concept', 'Opportunity Kind Concept', select=True)
# reference = fields.Selection([
# ('physical', "Physical"),
# ('electronic', "Electronic")], "Reference", select=True, sort=False,
# states={
# 'readonly': ~Eval('state').in_(['prospecting', 'analysis'])
# })
party = fields.Many2One(
'party.party', "Party", select=True,
states={
@ -194,6 +197,17 @@ class Opportunity(
('salesman', 'Salesman'),
('referred', 'Referred'),
], "Source", required=True, select=True)
cancelled_reason = fields.Selection([
('',''),
('Sin acuerdo', "No se llego a un acuerdo"),
('cliente_bloqueado', "No rentable para la empresa")], "Cancelled Reason", required=False,
states={
'invisible': ~Eval('state').in_(['analysis', 'review', 'quote_revision', 'cancelled', 'lost'])
}, depends=['state'])
# states={
# 'readonly': ~Eval('state').in_(['prospecting', 'analysis'])
# }
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')
@ -210,6 +224,7 @@ class Opportunity(
('analysis', 'prospecting'),
('analysis', 'quotation'),
('analysis', 'review'),
('analysis', 'cancelled'),
('review', 'quotation'),
('review', 'cancelled'),
('review', 'analysis'),
@ -281,7 +296,7 @@ class Opportunity(
'invisible': ~Eval('state').in_(['customer_approbation']),
},
'cancelled': {
'invisible': ~Eval('state').in_(['quote_revision','review']),
'invisible': ~Eval('state').in_(['analysis', 'quote_revision','review']),
},
})
@ -708,6 +723,18 @@ class PartyValidationOpportunity(ModelSQL, ModelView):
date = fields.Date('Date')
observation = fields.Text('Observation')
class OpportunityKindConcept(ModelSQL, ModelView):
''' Opportunity Kind Concept '''
'Opportunity Kind Concept'
__name__ = 'crm.opportunity_kind_concept'
name = fields.Char('Concept Name', required=True)
class OpportunityKind(ModelSQL, ModelView):
''' Opportunity Kind'''
__name__ = 'crm.opportunity.kind'
concept = fields.Many2One('crm.opportunity_kind_concept', 'Concept Opportunity Kind', required=True )
opportunity = fields.Many2One('crm.opportunity', 'Opportunity')
class OpportunityTraceability(ModelSQL, ModelView):
''' Model to save traceability of the opportunity'''
'Opportunity Traceability'
@ -745,9 +772,9 @@ class CrmOpportunityLine(sequence_ordered(), ModelSQL, ModelView):
states=_states, depends=['unit_digits'] + _depends)
unit = fields.Many2One('product.uom', 'Unit', required=True,
states=_states, depends=_depends)
# unit = fields.Function(fields.Many2One('product.uom', 'Unit', required=True,
# states=_states, depends=_depends),
# 'on_change_with_unit')
unit_digits = fields.Function(fields.Integer('Unit Digits'),
'on_change_with_unit_digits')
@ -778,15 +805,10 @@ class CrmOpportunityLine(sequence_ordered(), ModelSQL, ModelView):
return self.unit.digits
return 2
# @fields.depends('product')
# def on_change_with_unit_digits(self, name=None):
# if self.product:
# return self.product.list_price_uom
@fields.depends('product')
def on_change_with_unit(self, name=None):
def on_change_with_unit_price(self, name=None):
if self.product:
return self.product.list_price_uom
return self.product.list_price
@fields.depends('product')
def on_change_with_description(self, name=None):

View File

@ -13,14 +13,17 @@ this repository contains the full copyright notices and license terms. -->
<field name="address" colspan="3"/>
<label name="type"/>
<field name="type"/>
<newline/>
<label name="description"/>
<field name="description" colspan="3"/>
<label name="reference"/>
<field name="reference"/>
<field name="description" colspan="5"/>
<label name="kind_opportunity"/>
<field name="kind_opportunity"/>
<!-- <newline/> -->
<label name="source"/>
<field name="source"/>
<label name="reference"/>
<field name="reference"/>
<label name="amount"/>
<field name="amount" symbol="currency"/>
@ -43,15 +46,16 @@ this repository contains the full copyright notices and license terms. -->
<label name="converted_by"/>
<field name="converted_by"/>
<label name="start_date"/>
<field name="start_date"/>
<field name="start_date"/>s
<label name="end_date"/>
<field name="end_date"/>
<label name="payment_term"/>
<field name="payment_term"/>
<!-- <separator name="cancelled_reason" colspan="4"/> -->
<label name="cancelled_reason"/>
<field name="cancelled_reason"/>
<separator name="comment" colspan="4"/>
<field name="comment" colspan="4"/>
<separator name="lost_reason" colspan="4"/>
<field name="lost_reason" colspan="4"/>
</page>
<page name="lines">
<field name="lines"/>

View File

@ -14,5 +14,5 @@ this repository contains the full copyright notices and license terms. -->
<field name="unit"/>
<newline />
<label name="description"/>
<field name="description"/>
<field name="description"/>
</form>