mirror of
https://github.com/bringout/oca-technical.git
synced 2026-04-18 14:52:01 +02:00
Initial commit: OCA Technical packages (595 packages)
This commit is contained in:
commit
2cc02aac6e
24950 changed files with 2318079 additions and 0 deletions
|
|
@ -0,0 +1 @@
|
|||
from . import test_partner_find
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
# Copyright 2018 Creu Blanca
|
||||
# Copyright 2020 ForgeFlow S.L.
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
|
||||
from odoo.tests.common import TransactionCase
|
||||
|
||||
|
||||
class TestPartnerFind(TransactionCase):
|
||||
def test_partner(self):
|
||||
partner_obj = self.env["res.partner"]
|
||||
ref = "testing_partner_internal_reference"
|
||||
partner = partner_obj.create({"name": "Testing partner", "ref": ref})
|
||||
# We should find the partner when the ref is found
|
||||
self.assertEqual(
|
||||
partner.id,
|
||||
partner_obj.find_res_partner_by_ref_using_barcode(ref).get("res_id", False),
|
||||
)
|
||||
# No partner is found, then there is no res_id on the result
|
||||
self.assertFalse(
|
||||
partner_obj.find_res_partner_by_ref_using_barcode(
|
||||
"{}-{}".format(ref, ref)
|
||||
).get("res_id", False)
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue