Hello everyone
I've added a column to my custom module as show in the example below:
class res_partner(osv.osv):
_inherit = 'res.partner'
_columns = { 'x_invoice_partner': fields.boolean('Invoice partner', help="Select this if you want to send invoices to this person")
Then I added that field to my custom XML file as shown below:
<record id="view_partner_form" model="ir.ui.view">
<field name="name">res.partner.form</field>
<field name="model">res.partner</field>
<field eval="1" name="priority"/>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='use_parent_address']" position="after">
<field name="x_invoice_partner"/> </xpath>
</field> </record>
When I save this and restart the server I get this message: "column res_partner.x_invoice_partner does not exist" when I want to login. What exactly am I doing wrong here? Thanks in advance
EDIT: Sorry @zbik apparently I don't have enough karma to react to someone's response, I can't update the module since I get the error message when login. So I can't get past the login screen and thus can't get to the settings. Thanks in advance
You have a spaces or tabs before _inherit and before _columns?
@zbik Yes I have a tab before both of them, sorry I couldn't properly edit it in the post
You have a column 'x_invoice_partner' in database? (you upgrade your module or only restart the server?)
@zbik I've only restarted the server, I've read something about updating the database with a command in the terminal, is this needed?
Maybe add a column in the database manually, should help.
You update all modules by (if ubuntu or debian): $su - odoo -s /bin/bash $/usr/bin/openerp-server -d YOURDATABASE -u all --stop-after-init --config="/etc/openerp/openerp-server.conf"
If you are logged in, then remove from the database, and you perform Upgrade.