当前位置:网站首页>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"
边栏推荐
- 技术分享| 小程序实现音视频通话
- LeetCode_424_替换后的最长重复字符
- 17种正则表达式
- Two years of independent development experience Programmers tell us the experience of making money (listen to the masters who really make money)
- 手搓一个“七夕限定”,用3D Engine 5分钟实现烟花绽放效果
- 【微信小程序】信息管理与信息系统专业社会实习制作项目--垃圾指纹
- Ultra-QuickSort
- 动规(16)-并查集基础题——亲戚(Relations)
- d不要直接用转串
- 抽奖/秒杀/竞价/评分/权威/投票,技术教你用合适的方法做好活动
猜你喜欢

MATLAB——图像分块

LeetCode_424_替换后的最长重复字符

CLS-PEG-DBCO,胆固醇-聚乙二醇-二苯基环辛炔,可用于改善循环时间

程序猿七夕礼物-如何30分钟给女朋友快速搭建专属语聊房

倒计时 3 天|一起看云原生 Meetup 的六大议题

手搓一个“七夕限定”,用3D Engine 5分钟实现烟花绽放效果

Hit the interview!The latest interview booklet of Ali Jin, nine silver and ten is stable!

RK1126编译gdb 板子上gdb调试程序

来 TDengine 开发者大会,洞悉数据技术发展的未来趋势

rpm安装提示error: XXX: not an rpm package (or package manifest):
随机推荐
“蔚来杯“2022牛客暑期多校训练营4 N
【水一个徽章】
缓存中间件技术选型Memcached、MongoDB、Redis
Do you understand the various configurations in the project?
Ultra-QuickSort
Two years of independent development experience Programmers tell us the experience of making money (listen to the masters who really make money)
Valentine's Day Romantic 3D Photo Wall [with source code]
关于mysql join 的一些说明
持续交付(四)Jenkins多线程任务执行
业务中我们如何更新缓存?Redis
年轻人为什么不喜欢买蒙牛、伊利了?
【Game Of AutoTest】1、再度启程,重识游戏自动化测试
du命令_set命令选项
封装、继承、多态的联合使用实现不同等级学生分数信息的统计
到底什么是真正的HTAP?
持续交付(三)Jenkinsfile语法使用介绍
石子 无限拿
break与continue超详解!!!
Escape character is ‘^]’什么意思?怎么使用telnet
Django使用腾讯云发送短信并存入redis