Update and remove source

This commit is contained in:
oscar alvarez 2023-07-10 17:52:24 -05:00
parent 77910144c4
commit 7032168e68
4 changed files with 19 additions and 29 deletions

View File

@ -1 +1,2 @@
ALTER TABLE crm_opportunity_line RENAME time_ammount TO billing_frecuency;
ALTER TABLE crm_opportunity DROP COLUMN source;

View File

@ -180,17 +180,7 @@ class Opportunity(
states={
'readonly': Eval('state').in_(['won', 'lost'])
})
source = fields.Selection([
('website', 'Website'),
('phone', 'Phone'),
('email', 'Email'),
('whatsapp', 'WhatsApp'),
('salesman', 'Salesman'),
('referred', 'Referred'),
], "Source", required=True, select=True,
states={
'readonly': Eval('state').in_(['converted', 'won', 'lost'])
})
lead_origin = fields.Many2One('crm.lead_origin', 'Lead Origin')
total = fields.Function(fields.Float('Total'), 'get_total_opportunity')
total_without_tax = fields.Function(fields.Float('Total'),
'get_total_without_tax_opportunity')
@ -344,7 +334,7 @@ class Opportunity(
default.setdefault('sales', None)
default.setdefault('contracts', None)
default.setdefault('converted_by')
return super(CrmOpportunity, cls).copy(opportunities, default=default)
return super(Opportunity, cls).copy(opportunities, default=default)
def get_currency(self, name):
return self.company.currency.id
@ -374,20 +364,19 @@ class Opportunity(
Date = Pool().get('ir.date')
today = Date.today()
return {
'description':self.description,
'party':self.party,
'description': self.description,
'party': self.party,
# 'salesman':self.employee,
'payment_term':self.payment_term,
'company':self.company,
'currency':self.company.currency,
'comment':self.comment,
'reference':self.reference,
'contract_date':today,
'origin':self,
'state':'draft',
'payment_term': self.payment_term,
'company': self.company,
'currency': self.company.currency,
'comment': self.comment,
'reference': self.reference,
'contract_date': today,
'origin': self,
'state': 'draft',
}
def _get_sale_opportunity(self):
'''
Return sale for an opportunity

View File

@ -1,5 +1,5 @@
[tryton]
version=6.0.7
version=6.0.8
depends:
party
sale

View File

@ -2,12 +2,12 @@
<!-- 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="party_contact"/>
<field name="party_contact"/>
<label name="party"/>
<field name="party"/>
<label name="contact"/>
<field name="contact"/>
<label name="party_contact"/>
<field name="party_contact"/>
<label name="number"/>
<field name="number"/>
<label name="address"/>
@ -16,8 +16,8 @@ this repository contains the full copyright notices and license terms. -->
<field name="agent"/>
<label name="type"/>
<field name="type"/>
<label name="source"/>
<field name="source"/>
<label name="lead_origin"/>
<field name="lead_origin" widget="selection"/>
<label name="reference"/>
<field name="reference"/>
<label name="amount"/>
@ -33,7 +33,7 @@ this repository contains the full copyright notices and license terms. -->
<notebook colspan="6">
<page string="Opportunity" id="opportunity">
<label name="payment_term"/>
<field name="payment_term"/>
<field name="payment_term" widget="selection"/>
<label name="company"/>
<field name="company"/>
<label name="start_date"/>