From 41869d94949b4c8b830c4ea89e0605c844fdf979 Mon Sep 17 00:00:00 2001 From: Kristof Bernaert Date: Mon, 2 Feb 2026 11:17:29 +0100 Subject: [PATCH] legaladdress_from_customer --- .../__init__.py | 1 + .../__manifest__.py | 18 ++++++++++++++++++ .../models/__init__.py | 1 + .../models/account_move.py | 12 ++++++++++++ legaladdress_from_customer/__init__.py | 1 + legaladdress_from_customer/__manifest__.py | 16 ++++++++++++++++ legaladdress_from_customer/models/__init__.py | 2 ++ .../models/account_move.py | 12 ++++++++++++ .../models/sale_order.py | 12 ++++++++++++ 9 files changed, 75 insertions(+) create mode 100755 account_invoice_address_from_partner/__init__.py create mode 100755 account_invoice_address_from_partner/__manifest__.py create mode 100755 account_invoice_address_from_partner/models/__init__.py create mode 100755 account_invoice_address_from_partner/models/account_move.py create mode 100755 legaladdress_from_customer/__init__.py create mode 100755 legaladdress_from_customer/__manifest__.py create mode 100755 legaladdress_from_customer/models/__init__.py create mode 100755 legaladdress_from_customer/models/account_move.py create mode 100755 legaladdress_from_customer/models/sale_order.py diff --git a/account_invoice_address_from_partner/__init__.py b/account_invoice_address_from_partner/__init__.py new file mode 100755 index 0000000..0650744 --- /dev/null +++ b/account_invoice_address_from_partner/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/account_invoice_address_from_partner/__manifest__.py b/account_invoice_address_from_partner/__manifest__.py new file mode 100755 index 0000000..211a8ed --- /dev/null +++ b/account_invoice_address_from_partner/__manifest__.py @@ -0,0 +1,18 @@ +{ + "name": "Invoice address same as customer", + "version": "16.0.1.0.0", + "category": "Accounting", + "summary": "Keep invoice address exactly the same as the selected customer", + "description": """ +When selecting a customer on an invoice, the invoice address +(partner_invoice_id) is set to exactly the same partner record, +without collapsing to the commercial parent. +""", + "depends": [ + "account", + ], + "data": [], + "installable": True, + "application": False, + "license": "LGPL-3", +} diff --git a/account_invoice_address_from_partner/models/__init__.py b/account_invoice_address_from_partner/models/__init__.py new file mode 100755 index 0000000..9c0a421 --- /dev/null +++ b/account_invoice_address_from_partner/models/__init__.py @@ -0,0 +1 @@ +from . import account_move diff --git a/account_invoice_address_from_partner/models/account_move.py b/account_invoice_address_from_partner/models/account_move.py new file mode 100755 index 0000000..a7a29e3 --- /dev/null +++ b/account_invoice_address_from_partner/models/account_move.py @@ -0,0 +1,12 @@ +from odoo import api, models + + +class AccountMove(models.Model): + _inherit = "account.move" + + @api.onchange("partner_id") + def _onchange_partner_copy_to_invoice_address(self): + for move in self: + if move.partner_id: + # Copy Klant exactly to Factuuradres + move.partner_invoice_id = move.partner_id diff --git a/legaladdress_from_customer/__init__.py b/legaladdress_from_customer/__init__.py new file mode 100755 index 0000000..0650744 --- /dev/null +++ b/legaladdress_from_customer/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/legaladdress_from_customer/__manifest__.py b/legaladdress_from_customer/__manifest__.py new file mode 100755 index 0000000..7ce3990 --- /dev/null +++ b/legaladdress_from_customer/__manifest__.py @@ -0,0 +1,16 @@ +{ + "name": "Invoice legal address from customer", + "version": "16.0.1.0.0", + "category": "Accounting", + "summary": "Use the exact customer as invoice address", + "description": """ +Copies the selected customer (Klant) directly to the invoice address +on sale orders and invoices, without collapsing to the commercial partner. +""", + "depends": [ + "account", + "sale", + ], + "installable": True, + "license": "LGPL-3", +} diff --git a/legaladdress_from_customer/models/__init__.py b/legaladdress_from_customer/models/__init__.py new file mode 100755 index 0000000..df48fd8 --- /dev/null +++ b/legaladdress_from_customer/models/__init__.py @@ -0,0 +1,2 @@ +from . import account_move +from . import sale_order diff --git a/legaladdress_from_customer/models/account_move.py b/legaladdress_from_customer/models/account_move.py new file mode 100755 index 0000000..a7a29e3 --- /dev/null +++ b/legaladdress_from_customer/models/account_move.py @@ -0,0 +1,12 @@ +from odoo import api, models + + +class AccountMove(models.Model): + _inherit = "account.move" + + @api.onchange("partner_id") + def _onchange_partner_copy_to_invoice_address(self): + for move in self: + if move.partner_id: + # Copy Klant exactly to Factuuradres + move.partner_invoice_id = move.partner_id diff --git a/legaladdress_from_customer/models/sale_order.py b/legaladdress_from_customer/models/sale_order.py new file mode 100755 index 0000000..e8c9c1a --- /dev/null +++ b/legaladdress_from_customer/models/sale_order.py @@ -0,0 +1,12 @@ +from odoo import api, models + + +class SaleOrder(models.Model): + _inherit = "sale.order" + + @api.onchange("partner_id") + def _onchange_partner_copy_to_invoice_address(self): + for order in self: + if order.partner_id: + # Copy Klant exactly to Factuuradres + order.partner_invoice_id = order.partner_id