diff --git a/ext/custom-addons/dp_intercompany_invoicing/models/account.py b/ext/custom-addons/dp_intercompany_invoicing/models/account.py index 0da2390a..a84fccb5 100644 --- a/ext/custom-addons/dp_intercompany_invoicing/models/account.py +++ b/ext/custom-addons/dp_intercompany_invoicing/models/account.py @@ -68,7 +68,7 @@ class AccountInvoice(models.Model): for record in self: if not record.charge_further: raise ValidationError(_('Sie müssen mindestens eine Position mit WV markieren.')) - if record.charge_further: + if record.charge_further and not record.reimburse_invoice_id: intercompany_admin_id = record.company_id.admin_user_id in_invoice_vals = record._prepare_er_invoice_data() invoice_id = self.env['account.invoice'].sudo(intercompany_admin_id).create( diff --git a/ext/custom-addons/dp_intercompany_invoicing/views/account_views.xml b/ext/custom-addons/dp_intercompany_invoicing/views/account_views.xml index e2765d13..873e9fee 100644 --- a/ext/custom-addons/dp_intercompany_invoicing/views/account_views.xml +++ b/ext/custom-addons/dp_intercompany_invoicing/views/account_views.xml @@ -42,4 +42,13 @@ + + Intern Weiterverrechnen + + + action + code + records.reimburse_invoice() + + diff --git a/ext/custom-addons/dp_intercompany_invoicing/views/res_company_views.xml b/ext/custom-addons/dp_intercompany_invoicing/views/res_company_views.xml index 6ebc0efd..0e46d14a 100644 --- a/ext/custom-addons/dp_intercompany_invoicing/views/res_company_views.xml +++ b/ext/custom-addons/dp_intercompany_invoicing/views/res_company_views.xml @@ -14,13 +14,4 @@ - - Intern Weiterverrechnen - - - action - code - records.reimburse_invoice() - -