Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[12.0][PORT] 627 from 10.0 #762

Merged
merged 1 commit into from
Sep 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ def _m2m_to_external(self, record, backend_field, parser):
def country(self, record):
return {
"available_countries": self._m2m_to_external(
record, "allowed_country_ids", ["id", "name"]
record,
"allowed_country_ids",
["id", "name", ("state_ids:states", ["code", "name"])],
)
}

Expand Down
117 changes: 115 additions & 2 deletions shopinvader_locomotive/tests/test_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,121 @@ def test_synchronize_metadata(self):
},
"available_countries": {
"en": [
{"name": "France", "id": ref("base.fr").id},
{"name": "United States", "id": ref("base.us").id},
{
"name": "France",
"id": ref("base.fr").id,
"states": [],
},
{
"name": "United States",
"id": ref("base.us").id,
"states": [
{
u"code": u"AA",
u"name": u"Armed Forces Americas",
},
{
u"code": u"AE",
u"name": u"Armed Forces Europe",
},
{u"code": u"AK", u"name": u"Alaska"},
{u"code": u"AL", u"name": u"Alabama"},
{
u"code": u"AP",
u"name": u"Armed Forces Pacific",
},
{u"code": u"AR", u"name": u"Arkansas"},
{
u"code": u"AS",
u"name": u"American Samoa",
},
{u"code": u"AZ", u"name": u"Arizona"},
{u"code": u"CA", u"name": u"California"},
{u"code": u"CO", u"name": u"Colorado"},
{u"code": u"CT", u"name": u"Connecticut"},
{
u"code": u"DC",
u"name": u"District of Columbia",
},
{u"code": u"DE", u"name": u"Delaware"},
{u"code": u"FL", u"name": u"Florida"},
{
u"code": u"FM",
u"name": u"Federated States of Micronesia",
},
{u"code": u"GA", u"name": u"Georgia"},
{u"code": u"GU", u"name": u"Guam"},
{u"code": u"HI", u"name": u"Hawaii"},
{u"code": u"IA", u"name": u"Iowa"},
{u"code": u"ID", u"name": u"Idaho"},
{u"code": u"IL", u"name": u"Illinois"},
{u"code": u"IN", u"name": u"Indiana"},
{u"code": u"KS", u"name": u"Kansas"},
{u"code": u"KY", u"name": u"Kentucky"},
{u"code": u"LA", u"name": u"Louisiana"},
{
u"code": u"MA",
u"name": u"Massachusetts",
},
{u"code": u"MD", u"name": u"Maryland"},
{u"code": u"ME", u"name": u"Maine"},
{
u"code": u"MH",
u"name": u"Marshall Islands",
},
{u"code": u"MI", u"name": u"Michigan"},
{u"code": u"MN", u"name": u"Minnesota"},
{u"code": u"MO", u"name": u"Missouri"},
{
u"code": u"MP",
u"name": u"Northern Mariana Islands",
},
{u"code": u"MS", u"name": u"Mississippi"},
{u"code": u"MT", u"name": u"Montana"},
{
u"code": u"NC",
u"name": u"North Carolina",
},
{u"code": u"ND", u"name": u"North Dakota"},
{u"code": u"NE", u"name": u"Nebraska"},
{
u"code": u"NH",
u"name": u"New Hampshire",
},
{u"code": u"NJ", u"name": u"New Jersey"},
{u"code": u"NM", u"name": u"New Mexico"},
{u"code": u"NV", u"name": u"Nevada"},
{u"code": u"NY", u"name": u"New York"},
{u"code": u"OH", u"name": u"Ohio"},
{u"code": u"OK", u"name": u"Oklahoma"},
{u"code": u"OR", u"name": u"Oregon"},
{u"code": u"PA", u"name": u"Pennsylvania"},
{u"code": u"PR", u"name": u"Puerto Rico"},
{u"code": u"PW", u"name": u"Palau"},
{u"code": u"RI", u"name": u"Rhode Island"},
{
u"code": u"SC",
u"name": u"South Carolina",
},
{u"code": u"SD", u"name": u"South Dakota"},
{u"code": u"TN", u"name": u"Tennessee"},
{u"code": u"TX", u"name": u"Texas"},
{u"code": u"UT", u"name": u"Utah"},
{u"code": u"VA", u"name": u"Virginia"},
{
u"code": u"VI",
u"name": u"Virgin Islands",
},
{u"code": u"VT", u"name": u"Vermont"},
{u"code": u"WA", u"name": u"Washington"},
{u"code": u"WI", u"name": u"Wisconsin"},
{
u"code": u"WV",
u"name": u"West Virginia",
},
{u"code": u"WY", u"name": u"Wyoming"},
],
},
]
},
"currencies_rate": {
Expand Down