diff --git a/services/operation_services.py b/services/operation_services.py index 1485c1e2872a11a901cecaf6c0a2efe991e2a0d0..9e72a95a4adf826e76508d493b1782878e19ca18 100644 --- a/services/operation_services.py +++ b/services/operation_services.py @@ -249,7 +249,7 @@ class OperationsService(Component): if type == "invoice" and invoice_exist: datas["documents"] = ( - acc_account_ids.mapped( + acc_account_ids.sudo().mapped( lambda n: { "id": n.id, "name": n.name, @@ -257,6 +257,8 @@ class OperationsService(Component): "start_date": n.start_date, "end_date": n.end_date, "amount_total": n.amount_total, + "consumer": n.consumer_id.name, + "prm_c": n.acc_delivery_id.name, "url": base_url + n.get_portal_url(report_type="pdf"), } ) @@ -265,13 +267,14 @@ class OperationsService(Component): ) datas["factures_externes"] = ( - acc_contract_ids_f.mapped( + acc_contract_ids_f.sudo().mapped( lambda n: { "id": n.id, "name": n.name, "start_date": n.start_date, "end_date": n.end_date, "type": n.type, + "seller": n.seller_id.name, "url": base_url + n.get_portal_url(), } ) @@ -776,6 +779,8 @@ class OperationsService(Component): "end_date": {"type": "date", "nullable": True}, "amount_total": {"type": "float", "nullable": True}, "url": {"type": "string", "nullable": True}, + "consumer": {"type": "string", "nullable": True}, + "prm_c": {"type": "string", "nullable": True}, }, }, },