跳至内容
Odoo 菜单
  • 登录
  • 免费试用
  • 应用程序
    财务
    • 会计
    • 发票
    • 费用
    • 电子表格 (BI)
    • 文档
    • 电子签名
    销售
    • 客户关系管理
    • 销售
    • POS 销售点管理-零售
    • POS 销售点管理 - 餐厅
    • 订阅
    • 租赁
    网站
    • 网站设计
    • 电子商务
    • 博客
    • 论坛
    • 在线客服
    • 在线学习
    供应链
    • 库存
    • 制造
    • 产品生命周期
    • 采购
    • 维护保养
    • 品控
    人力资源
    • 员工
    • 招聘
    • 休假
    • 评价
    • 内部推荐
    • 车队
    营销
    • 社媒营销
    • 电邮营销
    • 短信营销
    • 近期活动
    • 营销自动化
    • 网上调查
    服务
    • 项目管理
    • 工时单
    • 现场服务
    • 服务台
    • 排期
    • 预约
    生产力
    • 讨论
    • 批核
    • IoT物联网
    • VoIP
    • 知识库
    • WhatsApp
    第三方应用软件 Odoo 定制 Odoo云端平台
  • 行业
    零售
    • 书店
    • 服装店
    • 家具店
    • 食品杂货店
    • 五金店
    • 玩具店
    餐饮与酒店服务
    • 酒吧及酒馆
    • 餐厅
    • 快餐
    • 民宿
    • 饮品分销商
    • 酒店
    房地产
    • 房地产代理
    • 建筑师事务所
    • 建造业
    • 地产管理
    • 园艺
    • 业主协会
    咨询
    • 会计师事务所
    • Odoo合作伙伴
    • 市场推广公司
    • 律师事务所
    • 人才招聘
    • 审核 & 认证
    制造
    • 纺织
    • 金属
    • 家具
    • 食品
    • 啤酒厂
    • 企业礼品
    保健与健身
    • 体育俱乐部
    • 眼镜店
    • 健身中心
    • 健康从业者
    • 药房
    • 发型屋
    商贸服务
    • 维修人员
    • IT 硬件及支持
    • 太阳能系统
    • 鞋匠
    • 清洁服务
    • 暖通空调服务
    其他
    • 非营利组织
    • 环境机构
    • 广告牌租赁
    • 摄影服务
    • 自行车租赁
    • 软件经销商
    浏览所有行业
  • 社区
    学习
    • 教学视频
    • 文档
    • 认证
    • 培训
    • 博客
    • 播客
    赋能教育
    • 教育计划
    • Scale Up! 商业游戏
    • 参观Odoo
    获取软件
    • 下载
    • 版本对比
    • 发布
    合作
    • Github
    • 论坛
    • 近期活动
    • 翻译
    • 成为合作伙伴
    • 合作伙伴服务
    • 注册您的会计事务所
    获取服务
    • 寻找合作伙伴
    • 查找会计服务
    • 预约顾问咨询
    • 安装及推行服务
    • 客户参考
    • 支持
    • 升级
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    获取演示
  • 定价
  • 技术支持

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • 客户关系管理
  • e-Commerce
  • 会计
  • 库存
  • PoS
  • 项目
  • MRP
All apps
只限注册用戶才可与社群互动。
所有帖文 人 徽章
标签 (查看所有)
odoo accounting v14 pos v15
关于此论坛区
只限注册用戶才可与社群互动。
所有帖文 人 徽章
标签 (查看所有)
odoo accounting v14 pos v15
关于此论坛区
帮助

Extending res.partner - first custom field worked, second raises "ProgrammingError: column ... does not exist" - what did I do wrong?

订阅

此帖文有活动时,接收通知

此问题已终结
res.partnerodoo10
8 回复
20018 查看
形象
Damon

I created and installed a module, barebones and everything was cool,

managed to add a field (cusvc_phone) to res.partner, verified in Models, but when I add the second field I get the following error

ProgrammingError: column res_partner.cusvc_email does not exist

My .py is as follows

# Merchant Application applicationfrom odoo import models, fields
#Extend res.partner model with customer service phone number
class Merchappl_respartner(models.Model):
        _inherit = 'res.partner'
        cusvc_phone = fields.Char('Customer Service Phone')
        cusvc_email = fields.Char('Customer Service Email')

It shouldn't be this hard to create a module which extends res.partner so I must be doing something wrong. Any help and/or pointers are much appreciated.

1
形象
丢弃
Damon
编写者

Apologies, but i have physically restarted my server many times to no avail. The only way I could get my changes to show was by creating a new database. It just wouldn't refresh my existing database. This wouldn't be a problem, but I have someone who is making changes to other applications, namely Website. I'll try to create and install a renamed version of my module and see if that takes in the existing database, fingers crossed.

形象
Krupesh Laiya
最佳答案

Just restart your server and use  while restarting - u MODULE_NAME -d DATABASE_NAME

hope this will solve your problem.

3
形象
丢弃
Damon
编写者

My installation is using the Yenthe script which autoruns the database upon startup so using:

./odoo-bin -d mydb -u Merchappl --- gives me an error 98 address already in use. even restarting doesn't pick it up Thank you though for your time.

Yenthe Van Ginneken (Mainframe Monkey)

@Damon in that case you should first stop the service (sudo service odoo-server stop) and then run the Odoo in the terminal with ./odoo-bin.py -u Merchappl.

(Nice to see you've used my script)

OdooBot

Awesome, thanks!

On Tue, Dec 6, 2016 at 11:35 AM Yenthe <yenthespam@gmail.com> wrote:

@Damon in that case you should first stop the service (sudo service odoo-server stop) and then run the Odoo in the terminal with ./odoo-bin.py -u Merchappl.

(Nice to see you've used my script)

--
Yenthe


Sent by Odoo S.A. using Odoo.

OdooBot
I'm SolutionArts via PayPal.
Thanks again for the script and service
Damon

On Tue, Dec 6, 2016 at 11:41 AM Damon John Hoxworth <damon@solutionarts.net> wrote:
Awesome, thanks!
On Tue, Dec 6, 2016 at 11:35 AM Yenthe <yenthespam@gmail.com> wrote:

@Damon in that case you should first stop the service (sudo service odoo-server stop) and then run the Odoo in the terminal with ./odoo-bin.py -u Merchappl.

(Nice to see you've used my script)

--
Yenthe


Sent by Odoo S.A. using Odoo.

Damon
编写者

Yenthe, when I run the (sudo service odoo-server stop) my Odoo installation is still available to me via 8069. When I run (service --status-all) the readout for Odoo shows "[?] odoo-server" indicating that it does not have a status command. It doesn't seem that odoo-server is infact stopping?

形象
Rob Baxter
最佳答案

I had a similar experience to Damon.  It seems to be a problem with the characters for spacing or line breaks.  I tried manipulating the text in both Bluefish and the gnome Text Editor.  Still got errors.

Finally I opened the .py file in nano at the command prompt.  Some of the line breaks and spacing was shown in a different colour.  After deleting these and replacing it finally worked.

Additional editing in nano seems to work.


1
形象
丢弃
形象
Burhan Vakharia
最佳答案

Hi Damon,


You need to restart the server and upgrade your module to reflect the new fields that you have created in the model.


Hope this helps,


Thank you

1
形象
丢弃
Damon
编写者

Thank you, should work for me, but is not.

形象
Masood Zarei
最佳答案

I had the same problem and doing as follow fix the issue:

  1. Stop your server
  2. Run this command at first:  python3 odoo-bin --update=purchase_request
  3. Reload your localhost in browser
  4. Upgrade your module
  5. Stop server again
  6. Now, using the old command (The command you use always) start server again
  7. Upgrade your module again
  8. Done.
0
形象
丢弃
形象
Mohammad Hassanzadeh
最佳答案

Hi,

I have this error when i add new field to base table such as res.users or res.partner,

if i run service by ugprade module command it is ok.

is there any way without upgrade module commad?

I want restart service and upgrade my module manualy. but is not possible.

thanks

0
形象
丢弃
形象
Art
最佳答案

Hi guys! I'm new to Odoo and I just decided to ask a question in this post instead of making the new one, b/c I had the same problem.

I'm using Odoo v10 and I'm trying to customize existing view (base.view_partner_form). Here are my model and view:

class add_supplier1099(models.Model):
    # _name = 'add.supplier1099'     
    _inherit = ['res.partner']     
    _description = "Add Checkbox and TaxID Field if Supplier Requires 1099"    

    supp_test_field = fields.Char(string="test field")


<odoo>     
    <data>
        <record id="add_supplier1099_view_inherit" model="ir.ui.view">
        <field name="name">res.partner.form</field>
        <field name="model">res.partner</field>
        <field name="inherit_id" ref="base.view_partner_form"/>
        <field name="arch" type="xml">     
            <xpath expr="//field[@name='phone']" position="after">                
                <field name="supp_test_field"/>     
            </xpath>
        </field>         
        </record>    
    </data>
</odoo>

This code works and it adds "supp_test_field" to the form. But if you uncomment # _name = 'add.supplier1099' (I thinks it should add my new field to an existing table of "res.partner" model) it'll through an error:

ValueError: Can't validate view:
Field `supp_test_field` does not exist

I also tried to go with "_name = res.partner" (I thinks it should create a new table with my new field and fields from "res.partner" model), but I was getting the same error. Any ideas why i'm getting this error in the above cases and not getting an error when I comment out "_name" attribute?

0
形象
丢弃
Damon
编写者

Hi Art. I think, and I might be way off, but I think that having your _name in the model isn't needed as you're inheriting the parent model res.partner So you're not really creating a new class, you're inheriting and modifying res.partner. I think that's the reason for the error.

Art

Damon, you're right, there was no need to have _name in my model. It worked well. And I was wrong: if _name and _inherit are the same (res.partner) it'll add a custom field to the existing model and if not then it'll create a new table with custom field and fields from an existing table.

So what is the difference between having _name = res.partner and not having it? Is it the same thing?

Damon
编写者

Art, I think having _name = res.partner is just redundant in that case.

Art

This is what odoo docs say:

_inherit:

- If _name is set, names of parent models to inherit from. Can be a str if inheriting from a single parent;

- If _name is unset, name of a single model to extend in-place.

Anyway as soon as it works I'm fine with it.

形象
Damon
编写者 最佳答案

I created a new database, and was able to proceed, but only so far.

The first 11 fields (41 total in .py) were added to res.partner and the remaining 30 fields were left alone. So tried multiple times, checked syntax etc. I ended up commenting out the first 11 fields that were being successfully added, created a new db, installed module and all uncommented fields (last 30) populated res.partner, as expected and doing nothing with the commented out first 11.

I don't understand what is happening here, maybe a timeout of some sort?

following are fields 11 and 12 for reference: (the breakpoint as near as I can tell)

itr_name = fields.Char('Name on Income Tax Return') 
prod_svcs = fields.Text('Detailed Explanation of Type of Merchandise, Products or Services Sold:')

Thanks for your time and eyes

0
形象
丢弃
Damon
编写者

Update: This is crazy, but i took my first 11 fields, and moved them to the end of my last 30 fields ran

./odoo-bin -d mydb -i mymodule

and res.partner shows my addl 41 fields in total. I still don't know what the issue was/is.

and res.partner was updated to my initial desire.

形象
Sarga
最佳答案

Hi,

i too have gone through similar situation .The changes that I make in my py wasn't reflecting.hence I checked if there where many instances running in my backend.There were many idle postgres instances and when I killed them and restarted everything was fine.

0
形象
丢弃
Damon
编写者

Thank you, but just isn't working for me.

喜欢讨论吗?不要只阅读,加入进来!

立即创建账户,享受专属功能,与我们的精彩社区互动!

注册
相关帖文 回复 查看 活动
Is there a differnce? commercial_company_name vs company_name 已解决
res.partner odoo10
形象
形象
2
12月 16
7261
Mass mailing how to prevent email sending 已解决
res.partner mass_mailing odoo10
形象
1
6月 18
4094
Odoo10: Cannot add a record to res.partner using a data file 已解决
res.partner data.xml odoo10
形象
1
1月 18
9259
I want to hide some res.partner address fields on the website from public visitors. I used a CSV file with READ permissions on res.partner to do this but it isn't working 已解决
res.partner website odoo10
形象
形象
形象
形象
7
11月 16
7484
Create schedule action For sending emails
odoo10
形象
形象
形象
2
7月 25
6568
社区
  • 教学视频
  • 文档
  • 论坛
开源
  • 下载
  • Github
  • Runbot
  • 翻译
服务
  • Odoo.sh 托管
  • 支持
  • 升级
  • 自定义开发服务
  • 教育
  • 查找会计服务
  • 寻找合作伙伴
  • 成为合作伙伴
关于我们
  • 我们的公司
  • 品牌资产
  • 联系我们
  • 招聘
  • 近期活动
  • 播客
  • 博客
  • 客户
  • 法律 • 隐私
  • 安全
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo致力于为企业管理提供高效智能的开源解决方案,是全球业内高速成长的软件服务商之一,逾七百五十万用户选择Odoo进行数字化升级。通过一系列全业务链覆盖、高度集成、简单易用的商业应用,助力企业实现信息化改革、降本增效并释放公司增长潜力。

Odoo独特的价值在于是一款非常容易使用又完全集成的应用。

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now