Melya template
This commit is contained in:
@@ -1623,13 +1623,12 @@
|
||||
<text:p text:style-name="P9"><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T11"><text:placeholder text:placeholder-type="text"><invoice.report_payment_description or ''></text:placeholder></text:span></text:span><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T11"> </text:span></text:span></text:p>
|
||||
<text:p text:style-name="P9"><text:placeholder text:placeholder-type="text"><if test="invoice.report_melya_maturity_date"></text:placeholder><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T8">Maturity date: </text:span></text:span><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T11"><text:placeholder text:placeholder-type="text"><format_date(invoice.report_melya_maturity_date, invoice.party.lang)></text:placeholder></text:span></text:span><text:placeholder text:placeholder-type="text"></if></text:placeholder></text:p>
|
||||
<text:p text:style-name="P5"/>
|
||||
<text:p text:style-name="P23"><text:placeholder text:placeholder-type="text"><if test="invoice.report_melya_bank_name"></text:placeholder>Bank: <text:placeholder text:placeholder-type="text"><invoice.report_melya_bank_name></text:placeholder><text:placeholder text:placeholder-type="text"></if></text:placeholder></text:p>
|
||||
<text:p text:style-name="P23"><text:placeholder text:placeholder-type="text"><invoice.report_melya_bank_details_line></text:placeholder></text:p>
|
||||
<text:p text:style-name="P9"><text:placeholder text:placeholder-type="text"><for each="line in invoice.report_melya_bank_address.splitlines()"></text:placeholder></text:p>
|
||||
<text:p text:style-name="P9"><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T11"><text:placeholder text:placeholder-type="text"><line></text:placeholder></text:span></text:span></text:p>
|
||||
<text:p text:style-name="P9"><text:placeholder text:placeholder-type="text"></for></text:placeholder></text:p>
|
||||
<text:p text:style-name="P5"/>
|
||||
<text:p text:style-name="P24"><text:placeholder text:placeholder-type="text"><if test="invoice.report_melya_bank_iban"></text:placeholder>IBAN : <text:placeholder text:placeholder-type="text"><invoice.report_melya_bank_iban></text:placeholder><text:placeholder text:placeholder-type="text"></if></text:placeholder></text:p>
|
||||
<text:p text:style-name="P24"><text:placeholder text:placeholder-type="text"><if test="invoice.report_melya_bank_swift"></text:placeholder>SwifT Code: <text:placeholder text:placeholder-type="text"><invoice.report_melya_bank_swift></text:placeholder><text:placeholder text:placeholder-type="text"></if></text:placeholder></text:p>
|
||||
<text:p text:style-name="P24"><text:placeholder text:placeholder-type="text"><invoice.report_melya_bank_account_line></text:placeholder></text:p>
|
||||
<text:p text:style-name="P5"/>
|
||||
</table:table-cell>
|
||||
</table:table-row>
|
||||
|
||||
@@ -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