Melya template

This commit is contained in:
2026-06-09 13:30:24 +02:00
parent 734c0c8a34
commit 67cb5491e2
5 changed files with 36 additions and 3 deletions

View File

@@ -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">&lt;invoice.report_payment_description or &apos;&apos;&gt;</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">&lt;if test=&quot;invoice.report_melya_maturity_date&quot;&gt;</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">&lt;format_date(invoice.report_melya_maturity_date, invoice.party.lang)&gt;</text:placeholder></text:span></text:span><text:placeholder text:placeholder-type="text">&lt;/if&gt;</text:placeholder></text:p>
<text:p text:style-name="P5"/>
<text:p text:style-name="P23"><text:placeholder text:placeholder-type="text">&lt;if test=&quot;invoice.report_melya_bank_name&quot;&gt;</text:placeholder>Bank: <text:placeholder text:placeholder-type="text">&lt;invoice.report_melya_bank_name&gt;</text:placeholder><text:placeholder text:placeholder-type="text">&lt;/if&gt;</text:placeholder></text:p>
<text:p text:style-name="P23"><text:placeholder text:placeholder-type="text">&lt;invoice.report_melya_bank_details_line&gt;</text:placeholder></text:p>
<text:p text:style-name="P9"><text:placeholder text:placeholder-type="text">&lt;for each=&quot;line in invoice.report_melya_bank_address.splitlines()&quot;&gt;</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">&lt;line&gt;</text:placeholder></text:span></text:span></text:p>
<text:p text:style-name="P9"><text:placeholder text:placeholder-type="text">&lt;/for&gt;</text:placeholder></text:p>
<text:p text:style-name="P5"/>
<text:p text:style-name="P24"><text:placeholder text:placeholder-type="text">&lt;if test=&quot;invoice.report_melya_bank_iban&quot;&gt;</text:placeholder>IBAN : <text:placeholder text:placeholder-type="text">&lt;invoice.report_melya_bank_iban&gt;</text:placeholder><text:placeholder text:placeholder-type="text">&lt;/if&gt;</text:placeholder></text:p>
<text:p text:style-name="P24"><text:placeholder text:placeholder-type="text">&lt;if test=&quot;invoice.report_melya_bank_swift&quot;&gt;</text:placeholder>SwifT Code: <text:placeholder text:placeholder-type="text">&lt;invoice.report_melya_bank_swift&gt;</text:placeholder><text:placeholder text:placeholder-type="text">&lt;/if&gt;</text:placeholder></text:p>
<text:p text:style-name="P24"><text:placeholder text:placeholder-type="text">&lt;invoice.report_melya_bank_account_line&gt;</text:placeholder></text:p>
<text:p text:style-name="P5"/>
</table:table-cell>
</table:table-row>

View File

@@ -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 = [

View File

@@ -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")

View File

@@ -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")

View File

@@ -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'