Repository
OCA/l10n-switzerland · module folder · Try on Runboat
Module version
1.0.0
Category
Uncategorized
Folder size
0.52 MB
License
AGPL-3
Application
No
Auto-installable
No
Website
https://github.com/OCA/l10n-switzerland
Last tracking update
2026-08-11 17:30:52
Authors
Camptocamp, Odoo Community Association (OCA)
Maintainers
Camptocamp, Odoo Community Association (OCA)
Committers
Ricardoalso, OCA-git-bot, oca-ci
Odoo dependencies
Python dependencies
ebilling_postfinance, zeep
System dependencies
None
Required by
None
Description
This module implements the exchange of electronic invoices with the
Postfinance web service.

Code Analysis

Views touched (8)
XML IDNameModelTypeStatus
ebill_payment_contract_form_view ebill.payment.contract.form (in ebill_postfinance) ebill.payment.contract form Inherits base_ebill_payment_contract.ebill_payment_contract_form_view
ebill_postfinance_invoice_message_form_view ebill.postfinance.invoice.message.form ebill.postfinance.invoice.message form New
ebill_postfinance_invoice_message_search_view ebill.postfinance.invoice.message.search ebill.postfinance.invoice.message search New
ebill_postfinance_invoice_message_tree_view ebill.postfinance.invoice.message.list ebill.postfinance.invoice.message list New
postfinance_service_form_view postfinance.service.form ebill.postfinance.service form New
postfinance_service_search_view postfinance.service.search ebill.postfinance.service search New
postfinance_service_tree_view postfinance.service.list ebill.postfinance.service list New
rejected_invoice rejected_invoice ir.ui.view qweb New
HTTP endpoints (0)

No HTTP endpoints found for this module.

Models touched (6)

New fields (0)

No new fields.

Public methods (5)
  • create_postfinance_ebill(self)
    Generate the message record for an invoice.
  • get_postfinance_other_reference(self)
    Allows glue module to insert <OTHER-REFERENCE> in the <HEADER> Add to the list ref, object strucutred like this: {'type': other reference allowed types, 'no': the content of <Reference-No> desired }
  • log_invoice_accepted_by_system(self)
  • log_invoice_refused_by_system(self)
  • postfinance_invoice_line_ids(self)
    Filter invoice line to be included in XML message. Invoicing line that are UX based (notes, sections) are removed.

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (5)
  • is_postfinance_contract Boolean
    compute='_compute_is_postfinance_contract' store=False
  • is_postfinance_method_on_partner Boolean
    compute='_compute_is_postfinance_method_on_partner'
  • payment_type Selection
    default='qr' help='Payment type to use for the invoices sent, PDF will be generated and attached accordingly.' selection=[('qr', 'QR')] string='Payment method'
  • postfinance_billerid Char
    help='The PayerID of the customer' size=20 string='Contract ID'
  • postfinance_service_id Many2one → ebill.postfinance.service
    comodel_name='ebill.postfinance.service' ondelete='restrict' string='Service'
Public methods (1)
  • set_postfinance_method_on_partner(self)

New fields (17)
  • attachment_id Many2one → ir.attachment
    args: 'ir.attachment', 'PDF'
  • ebill_account_number Char
    size=20 args: 'Payer Id'
  • ebill_payment_contract_id Many2one → ebill.payment.contract
    comodel_name='ebill.payment.contract'
  • file_type_used Char
  • invoice_id Many2one → account.move
    comodel_name='account.move' ondelete='restrict'
  • payload Text
    args: 'Payload sent'
  • payload_size Float
    digits=(6, 3) readonly=True args: 'Payload Size (MB)'
  • payment_type Selection
    default='iban' readonly=True selection=[('iban', 'IBAN'), ('credit', 'CREDIT'), ('other', 'OTHER'), ('dd', 'DD'), ('esr', 'ESR')]
  • ref Char
    size=35 args: 'Reference No.'
  • response Text
  • server_reason_code Integer
    string='Error code'
  • server_reason_text Char
    string='Error text'
  • server_state Selection
    selection=[('invalid', 'Invalid'), ('processing', 'Processing'), ('unsigned', 'Unsigned'), ('open', 'Open'), ('paid', 'Paid'), ('rejected', 'Rejected'), ('incomplete', 'Incomplete'), ('deleted', 'Deleted')]
  • service_id Many2one → ebill.postfinance.service
    comodel_name='ebill.postfinance.service' ondelete='restrict' readonly=True required=True string='Service used'
  • state Selection
    default='draft' selection=[('draft', 'Draft'), ('sent', 'Sent'), ('error', 'Error'), ('processing', 'Processing'), ('reject', 'Reject'), ('done', 'Done')]
  • submitted_on Datetime
    string='Submitted on'
  • transaction_id Char
Public methods (8)
  • format_date(date_string=None)
    @staticmethod
    Format a date in the Jinja template.
  • format_date_yb(date_string=None)
    @staticmethod
    Format a date in the Jinja template.
  • send_to_postfinance(self)
  • set_as_paid(self, data)
  • set_transaction_id(self)
  • update_invoice_status(self)
    Update the export status in the chatter.
  • update_message_from_server_data(self, data)
    Update the invoice message with data received from the server. Keyword arguments: data -- Structure from the api Example: { 'BillerId': '41101000001021209', 'TransactionId': 'INV_2022_03_0001_2022_03_26_08_31_xml', 'eBillAccountId': '123412341234', 'Amount': Decimal('0'), 'State': 'Invalid', 'PaymentType': None, 'ESRReferenceNbr': None, 'DeliveryDate': datetime.datetime(2022, 3, 26, 0, 0), 'PaymentDueDate': None, 'ReasonCode': '16', 'ReasonText': 'some good reason' }
  • validate_xml_payload(self)
    Check the validity of yellowbill xml.

New fields (13)
  • active Boolean
    default=True
  • biller_id Char
    required=True size=17 string='Biller ID'
  • ebill_payment_contract_ids One2many → ebill.payment.contract
    comodel_name='ebill.payment.contract' inverse_name='postfinance_service_id' readonly=True string='Contracts'
  • file_type_to_use Selection
    default='XML' required=True selection=[('XML', 'XML Yellow Bill'), ('EAI.XML', 'Custom XML (SAPiDoc)'), ('struct.pdf', 'Factur X')] string='Invoice Format'
  • invoice_message_ids One2many → ebill.postfinance.invoice.message
    comodel_name='ebill.postfinance.invoice.message' inverse_name='service_id' readonly=True string='Invoice Messages'
  • name Char
    required=True
  • operation_timeout Integer
    default='600' help='Timeout for each HTTP (GET, POST) request in seconds.' string='HTTP Timeout'
  • partner_bank_id Many2one → res.partner.bank
    comodel_name='res.partner.bank' ondelete='restrict' string='Bank account'
  • password Char
  • use_file_type_xml_paynet Boolean
    help='Enable use of legacy SIX/Paynet invoice format.' string='Use Paynet/SIX format'
  • use_test_service Boolean
    help='Target the test service' string='Testing'
  • username Char
  • xml_file_language Many2one → res.lang
    comodel_name='res.lang' help='The language used to generate the XML file, if unset default to the customer language.' string='XML file Language'
Public methods (10)
  • cron_update_invoices(self)
    @api.model
  • get_ebill_recipient_subscription_status(self, recipient_id)
  • get_invoice_list(self, archive_data=False)
  • get_process_protocol_list(self, archive_data=False)
  • get_registration_protocol(self, create_date, archive_data=False)
  • get_registration_protocol_list(self, archive_data=False)
  • ping_service(self, test_error=False, test_exception=False)
    Ping the service, uses the authentication. test_error: will create an unhandled error in the repsonse test_exception: will create a FaultException
  • search_invoice(self, transaction_id=None)
    Get invoice status from the server. transaction_id:
  • test_ping(self)
    Test the service from the UI.
  • upload_file(self, transaction_id, file_type, data)

New fields (1)
  • postfinance_ebill_client_order_ref Char
    compute='_compute_postfinance_ebill_client_order_ref'
Public methods (0)

No public methods.

Loading…

Loading…

Loading…

Loading…