mirror of
https://gitlab.com/datalifeit/trytond-sale_bancopal
synced 2023-12-14 04:22:54 +01:00
parent
e6bba2fd16
commit
db42d0503e
|
@ -3,6 +3,7 @@
|
|||
from trytond.pool import Pool
|
||||
from . import party
|
||||
from . import stock
|
||||
from . import sale
|
||||
|
||||
|
||||
def register():
|
||||
|
@ -10,4 +11,5 @@ def register():
|
|||
party.Party,
|
||||
party.BancopalPriceList,
|
||||
stock.Move,
|
||||
sale.Sale,
|
||||
module='sale_bancopal', type_='model')
|
||||
|
|
16
sale.py
Normal file
16
sale.py
Normal file
|
@ -0,0 +1,16 @@
|
|||
# The COPYRIGHT file at the top level of this repository contains the full
|
||||
# copyright notices and license terms.
|
||||
from trytond.pool import PoolMeta
|
||||
|
||||
__all__ = ['Sale']
|
||||
|
||||
|
||||
class Sale:
|
||||
__name__ = 'sale.sale'
|
||||
__metaclass__ = PoolMeta
|
||||
|
||||
def on_change_party(self):
|
||||
super(Sale, self).on_change_party()
|
||||
if self.party and self.party.bancopal and \
|
||||
self.party.bancopal_price_list:
|
||||
self.price_list = self.party.bancopal_price_list
|
|
@ -111,3 +111,11 @@ Discount applied when quantity is 10::
|
|||
>>> move.quantity = 10
|
||||
>>> move.unit_price
|
||||
Decimal('5.0000')
|
||||
|
||||
Create a sale::
|
||||
|
||||
>>> Sale = Model.get('sale.sale')
|
||||
>>> sale = Sale()
|
||||
>>> sale.party = customer
|
||||
>>> sale.price_list == price_list
|
||||
True
|
Loading…
Reference in a new issue