Skip to content

Commit

Permalink
[FIX] pos_order_to_sale_order_sale_financial_risk: The name of the pa…
Browse files Browse the repository at this point in the history
…rtner fields is put into a separate method.
  • Loading branch information
geomer198 committed Dec 22, 2023
1 parent 00dd01c commit 1f864b2
Showing 1 changed file with 17 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}
Expand Down

0 comments on commit 1f864b2

Please sign in to comment.