This commit is contained in:
oscar alvarez 2022-06-24 10:35:04 -05:00
parent 6f841b0286
commit 89f2b9bb55
2 changed files with 3 additions and 5 deletions

View File

@ -603,7 +603,6 @@ class Opportunity(
templates = ValidationTemplate.search([
('type', '=', _type),
])
print( 'templates ...', templates)
if not templates:
continue
@ -741,14 +740,13 @@ class Opportunity(
@classmethod
def procces_opportunity(cls, records):
pool = Pool()
for opportunity in records:
if opportunity.type == 'contract':
Contract = Pool().get('sale.contract')
Contract = pool.get('sale.contract')
contract = opportunity.create_contract()
Contract.create([contract])
else:
pool = Pool()
Sale = pool.get('sale.sale')
sales = [o.create_sale() for o in records if not o.sales]
Sale.save(sales)

View File

@ -19,7 +19,7 @@ class ValidationTemplate(ModelSQL, ModelView):
type = fields.Selection([
('prospect', 'Prospect'),
('client', 'Client')
],'Type')
], 'Type')
active = fields.Boolean('Active')
lines = fields.One2Many('crm.validation_template.ask',
'template', 'Asks')