Melya template
This commit is contained in:
@@ -849,6 +849,22 @@ class Invoice(metaclass=PoolMeta):
|
||||
return self._get_report_bank_swift(
|
||||
self._get_report_melya_bank_account())
|
||||
|
||||
@property
|
||||
def report_melya_bank_details_line(self):
|
||||
name = self.report_melya_bank_name
|
||||
return 'BANK DETAILS:\t\t%s' % name if name else ''
|
||||
|
||||
@property
|
||||
def report_melya_bank_account_line(self):
|
||||
parts = []
|
||||
iban = self.report_melya_bank_iban
|
||||
swift = self.report_melya_bank_swift
|
||||
if iban:
|
||||
parts.append('IBAN : %s' % iban)
|
||||
if swift:
|
||||
parts.append('Swift Code: %s' % swift)
|
||||
return ', '.join(parts)
|
||||
|
||||
@property
|
||||
def report_melya_maturity_date(self):
|
||||
maturity_dates = [
|
||||
|
||||
@@ -264,6 +264,12 @@ class PurchaseCrop(ModelSQL,ModelView):
|
||||
class Purchase(metaclass=PoolMeta):
|
||||
__name__ = 'purchase.purchase'
|
||||
|
||||
@classmethod
|
||||
@ModelView.button
|
||||
def confirm(cls, purchases):
|
||||
# Confirm is disabled in Trad'ON; keep the record in quotation.
|
||||
pass
|
||||
|
||||
btb = fields.Many2One('back.to.back',"Back to back")
|
||||
charter_conditions = fields.One2Many(
|
||||
'charter.condition', 'purchase', "Charter Conditions")
|
||||
|
||||
@@ -229,6 +229,12 @@ class Lot(metaclass=PoolMeta):
|
||||
class Sale(metaclass=PoolMeta):
|
||||
__name__ = 'sale.sale'
|
||||
|
||||
@classmethod
|
||||
@ModelView.button
|
||||
def confirm(cls, sales):
|
||||
# Confirm is disabled in Trad'ON; keep the record in quotation.
|
||||
pass
|
||||
|
||||
btb = fields.Many2One('back.to.back',"Back to back")
|
||||
charter_conditions = fields.One2Many(
|
||||
'charter.condition', 'sale', "Charter Conditions")
|
||||
|
||||
@@ -4458,6 +4458,12 @@ class PurchaseTradeTestCase(ModuleTestCase):
|
||||
invoice.report_melya_bank_iban,
|
||||
'CH36 0021 5215 2487 7461 D')
|
||||
self.assertEqual(invoice.report_melya_bank_swift, 'UBSWCHZH80A')
|
||||
self.assertEqual(
|
||||
invoice.report_melya_bank_details_line,
|
||||
'BANK DETAILS:\t\tUBS SWITZERLAND AG')
|
||||
self.assertEqual(
|
||||
invoice.report_melya_bank_account_line,
|
||||
'IBAN : CH36 0021 5215 2487 7461 D, Swift Code: UBSWCHZH80A')
|
||||
|
||||
def test_invoice_melya_maturity_date_uses_lines_to_pay(self):
|
||||
'invoice_melya maturity date uses the earliest line to pay maturity'
|
||||
|
||||
Reference in New Issue
Block a user