odoo学习之弹框显示
按条件隐藏:
<xpath expr="//group[1]" position="attributes">
<attribute name="attrs">{'invisible':[('uid_qx','=',False),('customer','=',True),('id','!=',False)]}</attribute>
</xpath>
<xpath expr="//div[@name='buttons']" position="attributes">
<attribute name="attrs">{'invisible':[('uid_qx','=',False),('customer','=',True),('id','!=',False)]}</attribute>
</xpath>
<xpath expr="//notebook" position="attributes">
<attribute name="attrs">{'invisible':[('uid_qx','=',False),('customer','=',True),('id','!=',False)]}</attribute>
</xpath>
binary: 二进制型,可存图片,文档
class="oe_edit_only"
options
:
options='{"no_open": True}' 不会弹出窗口 就是 many2oneXM 界面不再显示超链
options="{'reload_on_button': true}"
one2many 首先加载记录 然后调用按钮动作重新加载
options="{' always_reload': true}" one2many 每次插入数据时重新载入记录 nolabel="1" options="{'reload_on_button': true}"
def do_enter_prod_line(self, cr, uid, ids, context=None):
if not context:
context = {}
id=ids[0]
ctx={'default_manufac_id':id}
mod_obj = self.pool.get('ir.model.data')
form_res = mod_obj.get_object_reference(cr, uid, 'demo_sale', 'view_prod_choice_origin_form')
form_id = form_res and form_res[1] or False[0] or False
return {
'name': u'创建织造单',
'type': 'ir.actions.act_window',
'view_type': 'form',
'view_mode': 'form',
'res_model': 'prod.choice.origin',
'views': [(form_id, 'form')],
'view_id': form_id,
'target': 'new',
'context':ctx,
}
def add_za_order_line(self, cr, uid,man_id, record, context=None):
man_obj=self.pool.get('manufacture.origin')
id=man_id
vals={}
vals={'line_id':record}
print vals
self.write(cr,uid,[id],vals,context=context)
return True

class prod_choice_origin(osv.osv):
_name='prod.choice.origin'
_description='prod choice origin'
def action_add_za_order(self,cr,uid,ids,context=None):
assert len(ids)==1
result={}
mo_obj=self.pool.get('manufacture.origin')
zz_origin_obj=self.browse(cr,uid,ids,context)
man_id=zz_origin_obj.manufac_id.id
record=[]
i=0
for line_ids in zz_origin_obj.line_id:
if line_ids.choice==True:
record.append((0,0,{
'sequence':i+1,
'product_id':line_ids.product_id.id,
'plan_qty':line_ids.realy_qty,
'partner_id':line_ids.partner_id.id,
'lot_id':line_ids.lot_id.id,
}))
i+=1 mo_obj.add_za_order_line(cr,uid,man_id,record,context=None)
return True
_columns={
'manufac_id':fields.many2one('manufacture.origin',string=u'单号'),
'product_id':fields.many2one('product.product',string=u'物料',domain=[('categ_id','not in',[6])]),
'line_id':fields.one2many('prod.choice.origin.line','order_id',string=u'物料明细', copy=True),
}
class prod_choice_origin_line(osv.osv):
_name='prod.choice.origin.line'
_description='prod choice origin'
_columns={
'sequence':fields.integer(u'序号'),
'order_id':fields.many2one('prod.choice.origin',u'上级 单号',required=True, ondelete='cascade', select=True,),
'choice':fields.boolean(u'请选择'),
'product_id':fields.many2one('product.product',string=u'物料',domain=[('sale_ok', '=', True)]),
'partner_id':fields.many2one('res.partner', u'供应商',domain=[('supplier', '=', True)],select=True),
'wl_qty':fields.float(u'库存',),
'realy_qty':fields.float(u'实用数量'),
'location_id':fields.many2one('stock.location',u'位置'),
'date_in':fields.date(u'入库日期'),
}
_defaults = {
'sequence':1,
}
<?xml version="1.0"?>
<openerp>
<data>
<!--form view-->
<record id="view_prod_choice_origin_form" model="ir.ui.view">
<field name="name">prod.choice.origin.form</field>
<field name="model">prod.choice.origin</field>
<field name="arch" type="xml">
<form >
<sheet>
<h2>
<label string="物料选择"/>
</h2>
<notebook>
<page >
<group col="4">
<group>
<field name="product_id" on_change="onchange_product_id(product_id)"/>
</group>
<group></group>
<group></group>
<group></group>
</group>
<field name="line_id">
<tree editable="bottom">
<field name="sequence" />
<field name="choice" />
<field name="partner_id" />
<field name="product_id"/>
<field name="lot_id"/>
<field name="wl_qty" />
<field name="realy_qty" />
<field name="location_id"/>
<field name="date_in"/>
</tree>
</field>
</page>
</notebook>
<button name="action_add_za_order" string="添加" type="object" />
</sheet>
</form>
</field>
</record>
</data>
</openerp>
security.xml <record id="group_purchase_reopen_pring" model="res.groups">
<field name="category_id" ref="base.module_category_purchase_management" />
<field name="name">显示打印订单</field>
<field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>
<!--<field name="in_group_77" default="true"/>-->
<field name="comment">显示打印订单 </field>
</record>
<report
header="False"
attachment_use="False"
model="purchase.origin"
report_type="qweb-pdf"
id="print_purchase_add_menu_02"
string="订单打印"
name="demo_print_report.print_po_wx"
file="demo_print_report.print_po_wx"
groups="demo_purchase.group_purchase_reopen_print"
/>
produc_tobj_ids=productobj.search(cr,uid,[('pname','=',pna),('product_color_id','=',pcol_id),('categ_id','=',6)],limit =1, context=context)
odoo学习之弹框显示的更多相关文章
- 【jquery+easyUI】-- $.messager.show 弹框显示
三种基本弹框 1.提示框,一秒停留 $.messager.show({ title: '提示', msg: '修改成功!', showType: 'fade', //设置显示类型 style: { l ...
- 单击HighCharts柱形体弹框显示详细信息
上篇博客介绍了如何在HighCharts统计图表下生成表格,二者相互结合,可以对数据进行更好的统计分析.在统计的同时,如果需要想要及时查看详细信息的话,就得再加一个功能,就是单击柱形体,显示该项下的详 ...
- JavaScript 图片弹框显示
function fnCreate(src) { /* 要创建的div的classname */ var ClassName = "thumb ...
- win10系统rational rose 安装后打开弹框显示java.lang.ClassNotFoundException 解决方案
场景复现:安装Rational Rose,按照破解方法完成后,打开程序,会弹出对话框显示java.lang.ClassNotFoundException,在关闭程序时也会弹出一个对话框,并且程序不能关 ...
- vux弹框显示
//点击按钮,执行什么成功,失败用这个合适this.$vux.toast.show({ text: '添加成功'}) //点击按钮,提示出现的问题 this.$vux.toast.show({ tex ...
- android假设给TextView或EditText的email链接加下划线,并在点击在email连接上能够弹框显示
怎样把textview的一些文字加上背景色: Spannable str = new SpannableString("#fdsfdfsdfdsfd#"); Matcher mat ...
- winfrom 点击按钮button弹框显示颜色集
1.窗体托一个按钮button: 2.单击事件: private void btnForeColor_Click(object sender, EventArgs e) { using (ColorD ...
- layer.js 中弹框显示不全的问题
在使用 layer.js 做弹框的时候,遇到在浏览器缩小时,弹框显示不全的问题,如下: 这是不行的,因为我们有的时候想缩小浏览器视窗,但是一旦缩小到一定程度,就会把弹窗的关闭按钮遮住一部分,并且主体弹 ...
- dev右下角增加弹框提示信息
using System; using System.Drawing; using System.IO; using System.Threading; using System.Windows.Fo ...
随机推荐
- 【代码笔记】Web-ionic-颜色
一,效果图. 二,代码. <!DOCTYPE html> <html> <head> <meta charset="utf-8"> ...
- python之类与类之间的关系
在我们的世界中事物和事物之间总会有一些联系. 在面向对象中. 类和类之间也可以产生相关的关系 1. 依赖关系 执行某个动作的时候. 需要xxx来帮助你完成这个操作. 此时的关系是最轻的. 随时可以 ...
- python 提取linux的硬件信息
1.代码实现目的 注:代码可以直接粘贴使用 为了实现对主机的整体有明确的了解,实现了下面的代码功能 代码主要功能是: 提取到主机的内存.硬盘.CPU.型号等信息 插入到mysql的数据库中 2.代码具 ...
- kNN处理iris数据集-使用交叉验证方法确定最优 k 值
基本流程: 1.计算测试实例到所有训练集实例的距离: 2.对所有的距离进行排序,找到k个最近的邻居: 3.对k个近邻对应的结果进行合并,再排序,返回出现次数最多的那个结果. 交叉验证: 对每一个k,使 ...
- Android清单文件合并的那些事
APK文件只能包含一个AndroidManifest.xml文件,但Android Studio项目可以包含多个文件(通过buildSrc.导入的库引入).因此,在构建应用时,Gradle构建会将所有 ...
- 从零自学Java-10.充分利用现有对象
1.超类和子类的设计:2.建立继承层次:3.覆盖方法. 程序StringLister:使用数组列表和特殊的for循环将一系列字符串按字母顺序显示到屏幕上.这些字符串来自一个数组和命令行参数 packa ...
- 第六章 Hyper-V 2012 R2 的检查点
"检查点"是 Windows Server 2012 R2 中对 Windows Server 2012 及以前版本的 Hyper-V"快照"功能的新称呼.之所 ...
- if条件简单语法
if语句是实际工作中最重要最常用的语句. if条件语法: 单分支结构 if [ 条件 ] then 指令 fi 或 if [ 条件 ]:then 指令 fi if 单分支条件中文编程形象语法: 如果 ...
- Centos7下安装与卸载docker应用容器引擎
Docker 是一个开源的应用容器引擎,基于 Go 语言 并遵从Apache2.0协议开源. Docker 可以让开发者打包他们的应用以及依赖包到一个轻量级.可移植的容器中,然后发布到任何流行的 Li ...
- MySQL面试题之死锁
什么是死锁?锁等待?如何优化这类问题?通过数据库哪些表可以监控? 死锁是指两个或多个事务在同一资源上互相占用,并请求加锁时,而导致的恶性循环现象.当多个事务以不同顺序试图加锁同一资源时,就会产生死锁. ...