Skip to content

Commit

Permalink
[FIX] pos_partner_location_abstract: Code Refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
geomer198 committed Jan 7, 2024
1 parent 37c54c5 commit 18d3684
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const PartnerDetailsMapEdit = (PartnerDetailsEdit) =>
if (this.accessToMap) {
await this.partnerMap();
} else {
this.showPopup("ErrorPopup", {
await this.showPopup("ErrorPopup", {
title: this.env._t("Map Error"),
body: this.env._t("Cannot access map functions!"),
});
Expand All @@ -57,14 +57,14 @@ const PartnerDetailsMapEdit = (PartnerDetailsEdit) =>
identifyError(e) instanceof ConnectionLostError ||
ConnectionAbortedError
) {
this.showPopup("OfflineErrorPopup", {
await this.showPopup("OfflineErrorPopup", {
title: this.env._t("Network Error"),
body: this.env._t(
"Cannot access product information screen if offline."
),
});
} else {
this.showPopup("ErrorPopup", {
await this.showPopup("ErrorPopup", {
title: this.env._t("Unknown error"),
body: this.env._t(
"An unknown error prevents us from loading product information."
Expand Down
3 changes: 0 additions & 3 deletions pos_partner_location_abstract/tests/test_pos_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@

@tagged("post_install", "-at_install")
class PosSession(TestPointOfSaleCommon):
def setUp(self):
super(TestPointOfSaleCommon, self).setUp()

def test_loader_params_res_partner(self):
params = self.PosSession._loader_params_res_partner()
fields = params["search_params"]["fields"]
Expand Down
11 changes: 6 additions & 5 deletions pos_partner_location_abstract/tests/test_pos_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@
class TestPosUI(TestPointOfSaleHttpCommon):
def test_pos_partner_lang_lng(self):
partner = self.env["res.partner"].create({"name": "Test Partner"})
self.assertFalse(partner.partner_latitude)
self.assertFalse(partner.partner_longitude)
self.assertFalse(partner.partner_latitude, "Partner Latitude must be False")
self.assertFalse(partner.partner_longitude, "Partner Longitude must be False")
self.main_pos_config.open_ui()

self.start_tour(
f"/pos/ui?config_id={self.main_pos_config.id}",
"PartnerDetailTour",
login="accountman",
)
partner = self.env["res.partner"].search([("id", "=", partner.id)])
self.assertEqual(partner.partner_latitude, 15.0)
self.assertFalse(partner.partner_longitude)
self.assertEqual(
partner.partner_latitude, 15.0, "Partner Latitude must be equal to 15.0"
)
self.assertFalse(partner.partner_longitude, "Partner Longitude must be False")

0 comments on commit 18d3684

Please sign in to comment.