当前位置:网站首页>odoo13笔记点
odoo13笔记点
2022-08-04 12:59:00 【还是那个同伟伟】
tree视图上上对某个字典进行排序(默认是asc升序,desc降序)
<tree default_order="applicant_date desc"> <field name="applicant_date"/> </tree>
- 过程型的展示, 草稿----》已提交-----》审批中----》
<field name="state" widget="statusbar" readonly="1"/>
- 在create和write函数中传入的参数vals值中是没有的,无法直接从vals中获取。那怎么样可以让create函数和write函数获取到只读字段的值呢,方法其实很简单
force_save='1',字面意思就可以看出来,这个属性是强制保存的意思,这样,只读字段就可以保存了<field name="hr_department_id" readonly="1" force_save="1"/>
- xml中 default_focus="1"
default_focus:该字段是否获得默认焦点- postgresql中批量更新数据的sql
UPDATE account_account SET distribution_id = B.id FROM eno_fin_account B WHERE A.code = B.code
- odoo删除时弹框提示
def unlink(self): """ 重写删除函数 :return: """ for rec in self: if rec.state != 'created': raise ValidationError('仅允许删除状态为草稿的调动申请单!') return super(EnoHrApplicationResignation, self).unlink()
- 继承原表,给原表中的下拉框里面添加值,即给selection中添加值
# 员工状态添加 def _selection_state(self): res = super(EnoHrEmployee, self)._selection_state() res += [ ('to_be_hired', '待入职'), ('practice', '实习') ] return resstate = fields.Selection(selection=_selection_state)
子类继承,给父类添加下拉框的内容
application_model = fields.Selection(selection_add=[('eno_hr', '人力资源')])
- odoo中的已失效的挂件
<widget name="web_ribbon" title="已失效" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
- odoo中两个时间的间隔
def get_difference_year(self, do_date): """获取日期do_date和当前日期的年份差""" if do_date: return relativedelta(fields.Date.today(), do_date).years else: return 0
- postgresql根据查询的条件,然后删除对应的数据,套三级
delete from row_data where num not in(select mid from (select min(num) mid from row_data group by name,place,company,scale,salary,education,experience,label,welfare,type) as a);
- odoo个性化导入按钮
<field name="context">{'src_action': 'sdszl_hpm_personal_position_import_action'}</field> <act_window id="personal_position_import_action" name="导入" res_model="sdszl.hpm.personal.position.import" binding_model="sdszl.hpm.personal.position" view_mode="form" view_id="sdszl_hpm_personal_position_import_form" target="new" context="{'on_tree': '2', 'src_action': 'sdszl_hpm_personal_position_import_action'}"/>
- postgresql还原数据库
pg_restore -d "数据库名"-h localhost -p 5432 -U postgres -O postgres是数据库角色名称
- 进入docker容器内部
docker exec -it 容器名称 /bin/bash
- 行表,明细行可以多选
<xpath expr="/form/sheet/notebook/page[1]/field[@name='eno_hpm_secondary_distribution_ids']" position="attributes"> <attribute name="widget">multi_select_tree</attribute> <attribute name="res_model">eno.hpm.employee</attribute> <attribute name="res_field">name</attribute> </xpath>
- python碰见setup.py的模块怎么安装
python setup.py build python setup.py install
- odoo中的many2One()字段,让其只能选一次
widget="o2m_unique"
边栏推荐
- 广告电商系统开发
- 使用SQLServer复制数据库
- leetcode 48. Rotate Image 旋转图像(Medium)
- Valentine's Day Romantic 3D Photo Wall [with source code]
- Focus!2022 interview must brush 461 interview questions summary + interview + resume template
- 跨链桥已成行业最大安全隐患 为什么和怎么办
- ReentrantLock 原理
- 双目立体视觉学习笔记(一)
- 拥有一台服务器,程序猿装X的开始
- 持续交付(三)Jenkinsfile语法使用介绍
猜你喜欢

【解决方案 三十一】Navicat数据库结构同步

企业应当实施的5个云安全管理策略

使用SQLServer复制数据库

redis未授权访问漏洞【vulhub靶场】复现

【黑马早报】尚乘数科上市13天,市值超阿里;北大终止陈春花聘用合同;新东方花近200亿退学费和遣散费;张小泉75%产品贴牌代工...

Why don't young people like to buy Mengniu and Yili?

什么是 DevOps?看这一篇就够了!

Unity 3D模型展示框架篇之资源打包、加载、热更(Addressable Asset System | 简称AA)

判断密码是否包含键盘连续字母

Cool and efficient data visualization big screen, it's really not that difficult to do!丨Geek Planet
随机推荐
Two years of independent development experience Programmers tell us the experience of making money (listen to the masters who really make money)
Systemui qsSetting添加新图标
5 cloud security management strategies enterprises should implement
备份控制文件
接到“网站动态换主题”的需求,我是如何踩坑的
Cool and efficient data visualization big screen, it's really not that difficult to do!丨Geek Planet
【WeChat Mini Program】Social Internship Production Project for Information Management and Information System Major--Trash Fingerprint
RT-Thread stm32 基础记录
他是“中台”之父,凭一个概念为阿里狂赚百亿
正确使用Impala的invalidate metadata与refresh语句
Diffusion Models:生成扩散模型
广告电商系统开发之订单处理
新消费、出海、大健康......电子烟寻找“避风港”
ES 节点2G内存分析
c#学习_第二弹
PMP每日一练 | 考试不迷路-8.4(包含敏捷+多选)
Oracle 19c 单实例 19.3.0 升级到19.11.0 详细教程
双目立体视觉学习笔记(一)
技术分享| 小程序实现音视频通话
String是引用类型