Skip to Content
Menu
This question has been flagged

Hello everyone. I have a problem with adding country code to the customer tree view(in the accounting). Have browsed the forum and found this topic:
https://www.odoo.com/forum/help-1/question/how-to-add-vat-field-to-sales-order-model-134398

After putting my code I get:

 field = target._fields[name]
KeyError: 'country_id'

Class from my Python file (data folder):


from openerp import models, fields
class CountryCodeInvoice(models.Model):
# where to place new fields
    _inherit = 'account.invoice'
# getting country code to the accounting model
    code = fields.Char(string='Country Code', related='partner_id.code')
Avatar
Discard
Related Posts Replies Views Activity
1
Oct 15
6691
3
Sep 24
10000
3
Aug 24
5505
4
Jul 24
38818
2
Feb 24
605