Skip to content

Commit 2114694

Browse files
[FIX] l10n_vn_edi_viettel: no need buyer district, correct buyercity
* Problem: Since what has been described in odoo#214134 and https://thuvienphapluat.vn/chinh-sach-phap-luat-moi/vn/ho-tro-phap-luat/chinh-sach-moi/82581/tu-ngay-01-7-2025-ca-nuoc-se-khong-con-quan-huyen Vietnam no longer have district and city in city no more (Before in Vietnam we will have Thu Duc City belong to Ho Chi Minh State or Thuy Nguyen City belong to Hai Phong), Therefore we need to update Sinvoice data for this to. * This commit remove BuyerDistrict parameter , beside using state in the district is totally wrong and for 'buyerCityName' accept city or state field because odoo user might leave the city empty and just input state closes odoo#219368 X-original-commit: d4f424d Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
1 parent 79cce73 commit 2114694

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

addons/l10n_vn_edi_viettel/models/account_move.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,8 +628,7 @@ def _l10n_vn_edi_add_buyer_information(self, json_values):
628628
'buyerAddressLine': self.partner_id.street,
629629
'buyerPhoneNumber': commercial_partner_phone or '',
630630
'buyerEmail': self.commercial_partner_id.email or '',
631-
'buyerDistrictName': self.partner_id.state_id.name,
632-
'buyerCityName': self.partner_id.city,
631+
'buyerCityName': self.partner_id.city or self.partner_id.state_id.name,
633632
'buyerCountryCode': self.partner_id.country_id.code,
634633
'buyerNotGetInvoice': 0, # Set to 1 to no send the invoice to the buyer.
635634
}

addons/l10n_vn_edi_viettel/tests/test_edi.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def setUpClass(cls):
3838
cls.partner_a.write({
3939
'street': '121 Hang Bac Street',
4040
'state_id': cls.env.ref('base.state_vn_VN-HN').id,
41-
'city': 'Hoan Kiem District',
41+
'city': 'Hà Nội',
4242
'country_id': cls.env.ref('base.vn').id,
4343
'vat': '0100109106-505',
4444
'phone': '3825 7670',
@@ -116,8 +116,7 @@ def test_json_data_generation(self):
116116
'buyerAddressLine': '121 Hang Bac Street',
117117
'buyerPhoneNumber': '38257670',
118118
'buyerEmail': 'partner_a@gmail.com',
119-
'buyerDistrictName': 'Hà Nội',
120-
'buyerCityName': 'Hoan Kiem District',
119+
'buyerCityName': 'Hà Nội',
121120
'buyerCountryCode': 'VN',
122121
'buyerNotGetInvoice': 0,
123122
},

0 commit comments

Comments
 (0)