Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastienbeau committed Aug 9, 2023
1 parent e77ac46 commit 1f696c5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions shopinvader_quotation/tests/test_quotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def test_quotation(self):
self.assertEqual(self.cart.typology, "sale")

def test_only_quotation_in_cart_info(self):
self.backend.bind_all_product()
response = self.service.dispatch("search")
self.assertIn(
"only_quotation", response["data"]["lines"]["items"][0]["product"]
Expand Down
1 change: 1 addition & 0 deletions shopinvader_sale_packaging/tests/test_sale.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def setUp(self):
self.service = work.component(usage="sales")

def test_sale_line_data(self):
self.backend.bind_all_product()
res = self.service.search()
sale = res["data"][0]
for line in sale["lines"]["items"]:
Expand Down
6 changes: 3 additions & 3 deletions shopinvader_sale_profile/demo/account_fiscal_position.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
<!-- Copyright 2018 ACSONE SA/NV
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>
<record id="shopinvader.fiscal_position_0" model="account.fiscal.position">
<record id="shopinvader_v1_base.fiscal_position_0" model="account.fiscal.position">
<field name="company_id" ref="base.main_company" />
</record>

<record id="shopinvader.fiscal_position_1" model="account.fiscal.position">
<record id="shopinvader_v1_base.fiscal_position_1" model="account.fiscal.position">
<field name="company_id" ref="base.main_company" />
</record>

<record id="shopinvader.fiscal_position_2" model="account.fiscal.position">
<record id="shopinvader_v1_base.fiscal_position_2" model="account.fiscal.position">
<field name="company_id" ref="base.main_company" />
</record>
</odoo>
7 changes: 5 additions & 2 deletions shopinvader_v1_product/services/abstract_sale.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ def _get_product_information(self, line):
variant = line.product_id._get_invader_variant(
self.shopinvader_backend, line.order_id.partner_id.lang
)
return self._convert_one_line_product(variant)
if variant:
return self._convert_one_line_product(variant)
else:
return super()._get_product_information(line)

def _convert_one_line_product(self, variant):
return variant.get_shop_data() if variant else {}
return variant.get_shop_data()

0 comments on commit 1f696c5

Please sign in to comment.