Skip to content

Commit

Permalink
Merge PR #899 into 14.0
Browse files Browse the repository at this point in the history
Signed-off-by dhongu
  • Loading branch information
OCA-git-bot committed Mar 25, 2024
2 parents c0c0ffb + ec2f41b commit ec027ae
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion l10n_ro_city/data/res_city.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<odoo>
<record id="RO_1026" model="res.city">
<field name="name">Alba Iulia</field>
<field name="country_id" ref="base.ro" />
Expand Down
8 changes: 8 additions & 0 deletions l10n_ro_city/models/res_partner.py
Expand Up @@ -48,3 +48,11 @@ def onchange_zip(self):

if city:
self.city_id = city

@api.onchange("city_id")
def _onchange_city_id(self):
backup_zip = self.zip
res = super()._onchange_city_id()
if not self.zip and backup_zip:
self.zip = backup_zip
return res
Expand Up @@ -93,6 +93,7 @@ def test_onchange_vat_anaf(self):

mainpartner.vat = "4264242"
mainpartner.country_id = self.env.ref("base.ro")
mainpartner.zip = "031512"

self.assertEqual(mainpartner.name, "CUMPANA 1993 SRL")
self.assertEqual(mainpartner.street, "Str. Alexander Von Humboldt Nr. 10")
Expand Down

0 comments on commit ec027ae

Please sign in to comment.