From 1f864b212e0999a751aac22c37641b502159738e Mon Sep 17 00:00:00 2001 From: geomer198 Date: Fri, 22 Dec 2023 18:51:37 +0400 Subject: [PATCH] [FIX] pos_order_to_sale_order_sale_financial_risk: The name of the partner fields is put into a separate method. --- .../static/src/js/CreateOrderPopup.esm.js | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/pos_order_to_sale_order_sale_financial_risk/static/src/js/CreateOrderPopup.esm.js b/pos_order_to_sale_order_sale_financial_risk/static/src/js/CreateOrderPopup.esm.js index 02964fc89c..224d179a69 100644 --- a/pos_order_to_sale_order_sale_financial_risk/static/src/js/CreateOrderPopup.esm.js +++ b/pos_order_to_sale_order_sale_financial_risk/static/src/js/CreateOrderPopup.esm.js @@ -41,6 +41,22 @@ export const CreateOrderPopupRisk = (CreateOrderPopup) => return ""; } + /** + * Get Partners field list + * @returns {String[]} + * @private + */ + _getPartnerFields() { + return [ + "risk_exception", + "risk_sale_order_limit", + "risk_sale_order", + "risk_sale_order_include", + "risk_total", + "credit_limit", + ]; + } + /** * Get risk fields values for partner of order * @returns {Promise<*>} partner fields Object @@ -51,17 +67,7 @@ export const CreateOrderPopupRisk = (CreateOrderPopup) => const [partnerRiskValues] = await this.rpc({ model: "res.partner", method: "read", - args: [ - order.partner.id, - [ - "risk_exception", - "risk_sale_order_limit", - "risk_sale_order", - "risk_sale_order_include", - "risk_total", - "credit_limit", - ], - ], + args: [order.partner.id, this._getPartnerFields()], }); return partnerRiskValues; }