Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
4459 Переглядів

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')
Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
1
жовт. 15
7606
3
трав. 25
1603
1
квіт. 25
1214
1
груд. 24
5977
3
вер. 24
14068