mirror of
https://github.com/NaN-tic/trytond-sale_opportunity_quote-zz.git
synced 2023-12-14 07:22:57 +01:00
Create sale and related with sale opportunity
This commit is contained in:
parent
7acabb50e3
commit
2adad114ef
2 changed files with 10 additions and 1 deletions
|
@ -3,7 +3,7 @@
|
|||
# copyright notices and license terms.
|
||||
|
||||
from trytond.model import fields
|
||||
from trytond.pool import PoolMeta
|
||||
from trytond.pool import Pool, PoolMeta
|
||||
|
||||
__metaclass__ = PoolMeta
|
||||
|
||||
|
@ -15,6 +15,13 @@ class SaleOpportunity:
|
|||
|
||||
quotes = fields.One2Many('sale.sale', 'opportunity', 'Sales')
|
||||
|
||||
def create_sale(self):
|
||||
Sale = Pool().get('sale.sale')
|
||||
|
||||
sale = super(SaleOpportunity, self).create_sale()
|
||||
Sale.write([sale], {'opportunity': self.id})
|
||||
return sale
|
||||
|
||||
|
||||
class Sale:
|
||||
__name__ = 'sale.sale'
|
||||
|
|
|
@ -2,3 +2,5 @@
|
|||
# copyright notices and license terms.
|
||||
|
||||
from .test import suite
|
||||
|
||||
__all__ = ['suite']
|
||||
|
|
Loading…
Reference in a new issue