Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • coopdevs/som-connexio/odoo/odoo-somconnexio-python-client
1 result
Show changes
Commits on Source (2)
...@@ -30,6 +30,7 @@ class Partner: ...@@ -30,6 +30,7 @@ class Partner:
member, member,
addresses, addresses,
banned_actions, banned_actions,
is_company,
**kwargs **kwargs
): ):
self.id = id self.id = id
...@@ -53,6 +54,7 @@ class Partner: ...@@ -53,6 +54,7 @@ class Partner:
for address in addresses: for address in addresses:
self.addresses.append(Address(**address)) self.addresses.append(Address(**address))
self.banned_actions = banned_actions self.banned_actions = banned_actions
self.is_company = is_company
@classmethod @classmethod
def get(cls, ref): def get(cls, ref):
......
...@@ -3,7 +3,7 @@ interactions: ...@@ -3,7 +3,7 @@ interactions:
body: null body: null
headers: headers:
API-KEY: API-KEY:
- DUMMY - '****'
Accept: Accept:
- application/json - application/json
Accept-Encoding: Accept-Encoding:
...@@ -16,30 +16,30 @@ interactions: ...@@ -16,30 +16,30 @@ interactions:
uri: http://odoo-sc.local:8069/api/partner/1234 uri: http://odoo-sc.local:8069/api/partner/1234
response: response:
body: body:
string: !!python/unicode '{"id": 52, "name": "Felip Dara", "firstname": "Felip", string: '{"id": 50, "name": "Felip Dara", "firstname": "Felip", "lastname":
"lastname": "Dara", "display_name": "Dara", "ref": "1234", "lang": "en_US", "Dara", "display_name": "Dara", "ref": "1234", "lang": "es_ES", "vat": "ES55642302N",
"vat": "ES55642302N", "type": "representative", "email": "felipdata@demo.net", "type": "representative", "email": "felipdata@demo.net", "phone": "", "mobile":
"phone": "", "mobile": "", "cooperator_register_number": 855, "cooperator_end_date": "", "cooperator_register_number": 855, "cooperator_end_date": "", "sponsor_ref":
"", "sponsor_ref": 0, "coop_agreement_code": "", "coop_candidate": false, "member": "", "coop_agreement_code": "", "sponsorship_code": "RYR6O", "sponsees_number":
true, "addresses": [{"street": "Carrer del Penal, 2", "zip_code": "17855", "city": 1, "sponsees_max": 5, "coop_candidate": false, "member": true, "addresses":
"Oix", "country": "Spain", "state": "Girona (Gerona)"}], "banned_actions": [{"street": "Carrer del Penal, 2", "zip_code": "17855", "city": "Oix", "country":
["mobile_one_shot", "mobile_tariff_change", "new_service"]}' "Spain", "state": "Girona (Gerona)"}], "banned_actions": ["new_service", "mobile_one_shot",
"mobile_tariff_change"], "inactive_sponsored": false, "is_company": false}'
headers: headers:
Access-Control-Allow-Methods: Access-Control-Allow-Methods:
- GET - GET
Access-Control-Allow-Origin: Access-Control-Allow-Origin:
- None - None
Content-Length: Content-Length:
- '517' - '717'
Content-Type: Content-Type:
- application/json - application/json
Cookie: '****'
Date: Date:
- Wed, 19 Jan 2022 09:24:32 GMT - Thu, 06 Feb 2025 08:20:58 GMT
Server: Server:
- Werkzeug/0.11.15 Python/3.7.7 - Werkzeug/0.11.15 Python/3.7.7
Set-Cookie: Set-Cookie: '****'
- session_id=7bbc7f3ced360754ef8243715949ee210d187d12; Expires=Tue, 19-Apr-2022
09:24:32 GMT; Max-Age=7776000; HttpOnly; Path=/
status: status:
code: 200 code: 200
message: OK message: OK
......
...@@ -3,7 +3,7 @@ interactions: ...@@ -3,7 +3,7 @@ interactions:
body: null body: null
headers: headers:
API-KEY: API-KEY:
- DUMMY - '****'
Accept: Accept:
- application/json - application/json
Accept-Encoding: Accept-Encoding:
...@@ -16,30 +16,30 @@ interactions: ...@@ -16,30 +16,30 @@ interactions:
uri: http://odoo-sc.local:8069/api/partner?vat=55642302N uri: http://odoo-sc.local:8069/api/partner?vat=55642302N
response: response:
body: body:
string: !!python/unicode '{"id": 52, "name": "Felip Dara", "firstname": "Felip", string: '{"id": 50, "name": "Felip Dara", "firstname": "Felip", "lastname":
"lastname": "Dara", "display_name": "Dara", "ref": "1234", "lang": "en_US", "Dara", "display_name": "Dara", "ref": "1234", "lang": "es_ES", "vat": "ES55642302N",
"vat": "ES55642302N", "type": "representative", "email": "felipdata@demo.net", "type": "representative", "email": "felipdata@demo.net", "phone": "", "mobile":
"phone": "", "mobile": "", "cooperator_register_number": 855, "cooperator_end_date": "", "cooperator_register_number": 855, "cooperator_end_date": "", "sponsor_ref":
"", "sponsor_ref": 0, "coop_agreement_code": "", "coop_candidate": false, "member": "", "coop_agreement_code": "", "sponsorship_code": "RYR6O", "sponsees_number":
true, "addresses": [{"street": "Carrer del Penal, 2", "zip_code": "17855", 1, "sponsees_max": 5, "coop_candidate": false, "member": true, "addresses":
"city": "Oix", "country": "Spain", "state": "Girona (Gerona)"}], [{"street": "Carrer del Penal, 2", "zip_code": "17855", "city": "Oix", "country":
"banned_actions": ["mobile_one_shot", "mobile_tariff_change", "new_service"]}' "Spain", "state": "Girona (Gerona)"}], "banned_actions": ["new_service", "mobile_one_shot",
"mobile_tariff_change"], "inactive_sponsored": false, "is_company": false}'
headers: headers:
Access-Control-Allow-Methods: Access-Control-Allow-Methods:
- GET - GET
Access-Control-Allow-Origin: Access-Control-Allow-Origin:
- None - None
Content-Length: Content-Length:
- '517' - '717'
Content-Type: Content-Type:
- application/json - application/json
Cookie: '****'
Date: Date:
- Wed, 19 Jan 2022 09:24:32 GMT - Thu, 06 Feb 2025 08:20:58 GMT
Server: Server:
- Werkzeug/0.11.15 Python/3.7.7 - Werkzeug/0.11.15 Python/3.7.7
Set-Cookie: Set-Cookie: '****'
- session_id=cd73bf3b6b85d5fb1258d13e1b5f0f18c1c82487; Expires=Tue, 19-Apr-2022
09:24:32 GMT; Max-Age=7776000; HttpOnly; Path=/
status: status:
code: 200 code: 200
message: OK message: OK
......
...@@ -33,6 +33,7 @@ class PartnerTests(unittest.TestCase): ...@@ -33,6 +33,7 @@ class PartnerTests(unittest.TestCase):
assert "mobile_one_shot" in partner.banned_actions assert "mobile_one_shot" in partner.banned_actions
assert "mobile_tariff_change" in partner.banned_actions assert "mobile_tariff_change" in partner.banned_actions
assert "new_service" in partner.banned_actions assert "new_service" in partner.banned_actions
self.assertFalse(partner.is_company)
@pytest.mark.vcr() @pytest.mark.vcr()
def test_check_sponsor_ok(self): def test_check_sponsor_ok(self):
......