fix
This commit is contained in:
parent
6f841b0286
commit
89f2b9bb55
|
@ -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)
|
||||
|
|
|
@ -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')
|
||||
|
|
Loading…
Reference in New Issue