跳转至内容
  • 版块
  • 标签
  • 热门
  • 用户
  • 群组
皮肤
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • 默认(Flatly)
  • 不使用皮肤
折叠

Odoo 中文社区

L

l315276651

@l315276651
关于
帖子
25
主题
11
群组
0
粉丝
0
关注
0

帖子

最新 最佳 有争议的

  • 天津招聘odoo 开发人员 待遇优 环境棒
    L l315276651

    看来odoo的市场还不错,可惜我大武汉没人玩odoo


  • Odoo 上海开源开发者聚会 5月6日举办成功
    L l315276651

    报名参加,凑足8个字


  • Onchange context 丢失
    L l315276651

    今天发现一个问题  当用defalut_get 设置 fieldA 并触发 fieldA onchange方式的时候
    onchange 方法内的 context =None

    解决办法:
    在 xml的onchange 参数中 加上context
    <field name="xxx" onchange="onchange_xxx(agrs*,context)"


  • [已解决] 无法显示 非启用用户
    L l315276651

    今天遇到一个问题 设置-用户-用户 中 无法显示 非启用( active = False )的用户
    谷歌了一下 只能添加默认过滤器 来解决这个"BUG" 留贴记录一下 具体方法如下:

    设置->技术->用户界面->用户自定义过滤器  创建一条过滤器

    模型:Users
    默认过滤器: True
    过滤条件: ['|',("active","=",False),("active","=",True)]


  • [已解决]根据form数据 控制默认按钮(编辑/创建)
    L l315276651

    <record id="invoice_form_inherit" model="ir.ui.view">
        <field name="name">invoice.form.inherit</field>
        <field name="model">account.invoice</field>
        <field name="inherit_id" ref="account.invoice_form"/>
        <field name="arch" type="xml">
            <xpath expt='//form[@string="Invoice"]' possition='attributes'>

                <!-- Frist intent : nothing happened -->
                <attribute name="edit" attrs="{'invisible:[('state','=','paid')]'}"/>

                <!-- Second intent : edit, always hide -->
                <attribute name="edit" attrs="{'invisible:[('state','=','paid')]'}">false</field>

                <!-- Thirds intent : edit, never hide -->
                <attribute name="edit" attrs="{'invisible:[('state','=','paid')]'}">true</field>
        </field>


  • 为 action 指定 tree 和 view
    L l315276651

    很多同学 继承了某个模块后 就遇到一个很头疼的问题
    就是 menu 可以打开指定的 tree  ,而tree点击进去后
    是模块默认的 form
    在 http://www.3e3c.com/erp-213.html 里面 看到一文章 有点启发
    废话不多说  上代码  ;D

    <br />模块继承 res.company<br /><br /> &lt;record id=&quot;tree_id&quot; model=&quot;ir.ui.view&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field name=&quot;name&quot;&gt;res.company.tree&lt;/field&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field name=&quot;model&quot;&gt;res.company&lt;/field&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field name=&quot;arch&quot; type=&quot;xml&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tree&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 字段<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/tree&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/field&gt;<br />&lt;/record&gt;<br /><br />&nbsp; &nbsp; &nbsp; &lt;record id=&quot;action_company_tree&quot; model=&quot;ir.actions.act_window&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field name=&quot;name&quot;&gt;res.company&lt;/field&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field name=&quot;res_model&quot;&gt;res.company&lt;/field&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field name=&quot;view_type&quot;&gt;form&lt;/field&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field name=&quot;view_mode&quot;&gt;tree,form&lt;/field&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field name=&quot;view_id&quot; ref=&quot;tree_id&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/record&gt;<br /><br />以上是正常的 tree action的定义 ,重点来了 ;D<br /><br /><br /> &lt;record id=&quot;action_company_tree_view1&quot; model=&quot;ir.actions.act_window.view&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field eval=&quot;1&quot; name=&quot;sequence&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field name=&quot;view_mode&quot;&gt;tree&lt;/field&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field name=&quot;act_window_id&quot; ref=&quot;action_company_tree&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/record&gt;<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;record id=&quot;action_company_tree_view2&quot; model=&quot;ir.actions.act_window.view&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field eval=&quot;2&quot; name=&quot;sequence&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field name=&quot;view_mode&quot;&gt;form&lt;/field&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [size=12pt][color=red][b]&lt;field name=&quot;view_id&quot; ref=&quot;invoice_form&quot;/&gt;[/b][/color][/size]<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field name=&quot;act_window_id&quot; ref=&quot;action_company_tree&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/record&gt;<br /><br /><br />这里就是指定 act_window 打开的 tree 和 form&nbsp; ,所有的 action 都可以指定 <br />
    

  • 动态domain
    L l315276651

    各位大神 ,小弟现在遇到一个问题  关于动态domain的问题
    比如 我有个class A 和产品 P 是many2many的关系,但是 P 只允许选一次
    我的做法是在P 中 添加了一个字段 selected  ,当A保存的时候 修改 P的selected为True
    同时 A 对P 的domain 是  selected =False ,当A创建成功后 A中 看不到选过的P数据
    请问有什么好的解决办法吗


  • Openerp 页面跳转
    L l315276651

    请问 分享链接 可以实现 参数的传递吗 我需要在外部地址 通过 href 连接到openerp,
    最好能带上参数 比如登录的帐号 密码,需要查看的 模块,视图类型 这样的个性化参数
    然后在python里面 更具参数 return view


  • Openerp 页面跳转
    L l315276651

    😞 最近在研究 如何从第三方平台 通过URL  直接打开openerp 某个模块的 tree / form ,
    尝试url传递参数  似乎不行
    不知有什么好的解决方案  :-[ :-[ :-[ :-[


  • Many2one 动态 domain
    L l315276651

    [quote author=Jeff link=topic=16515.msg28547#msg28547 date=1406109802]
    在on_change 里 ,设置 字段B的 domain

    就这么实现啊,代码里搜onchange,必有一款适合您
    [/quote]

    谢谢Jeff的回复 在 res_partner.py 中找到了相关用法

    <br />&nbsp; &nbsp; def onchange_type(self, cr, uid, ids, is_company, context=None):<br />&nbsp; &nbsp; &nbsp; &nbsp; value = {}<br />&nbsp; &nbsp; &nbsp; &nbsp; value&#91;&#039;title&#039;] = False<br />&nbsp; &nbsp; &nbsp; &nbsp; if is_company:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; domain = {&#039;title&#039;: [(&#039;domain&#039;, &#039;=&#039;, &#039;partner&#039;)]}<br />&nbsp; &nbsp; &nbsp; &nbsp; else:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; domain = {&#039;title&#039;: [(&#039;domain&#039;, &#039;=&#039;, &#039;contact&#039;)]}<br />&nbsp; &nbsp; &nbsp; &nbsp; return {&#039;value&#039;: value, &#039;domain&#039;: domain}<br />
    

  • Many2one 动态 domain
    L l315276651

    最近在一个功能 类似于 select 的级联操作, A change 动态加载 B中的值
    在OE中 就是 many2one 字段  在on_change 里 ,设置 字段B的 domain
    请问各位大神 这个功能在OE里面 怎么实现?


  • 求助:widget 写入值
    L l315276651

    ;D 最近研究web框架 有点小收获 , 由于OE框架的限制 很多UI功能 需要自己写widget,现遇到一难题
    数据库有一字段 A 数据类型为 datatime ,现在只想保存 时分秒, 于是开发了一个widget 叫mytime
    编辑的时候 用3个select 分别代替时分秒,问题来了  拼接好的 数据 如何回传?


  • OpenERP Web Reference Documentation 文档翻译
    L l315276651

    整个文档翻译的不错  但遗漏了 一些很重要的信息
    如 

    instance.web.client_actions.add(&#039;petstore.homepage&#039;, &#039;instance.oepetstore.HomePage&#039;); 
    

    中
    如何写这个 petstore.homepage client_actions
    通过查看原文档 得知

    <br />&lt;record id=&quot;action_home_page&quot; model=&quot;ir.actions.client&quot;&gt;<br />&nbsp; &nbsp;  &lt;field name=&quot;name&quot;&gt;Inbox&lt;/field&gt;<br />&nbsp; &nbsp;  &lt;field name=&quot;tag&quot;&gt;petstore.homepage&lt;/field&gt;<br />&lt;/record&gt;<br /><br />&lt;menuitem id=&quot;home_page_petstore_menu&quot; name=&quot;Home Page&quot; parent=&quot;petstore_menu&quot;<br />action=&quot;action_home_page&quot;/&gt;&nbsp; <br /> 
    


    需要注意的是  model="ir.actions.client"  ;D ;D


  • [分享]view xml 中的 button 调用web客户端事件
    L l315276651

    [quote author=l315276651 link=topic=14690.msg28138#msg28138 date=1401933677]
    目前我也遇到了这样的问题 ,
    我是通过 添加 html的input标签
    然后用js调用Python方法,
    但感觉很怪 ,你这样的方式 不错 ,只是有一个问题,
    怎么传递参数呢 如 ids
    [/quote]

    目前我也遇到了这样的问题 ,
    我是通过 添加 html的input标签
    然后用js调用Python方法,
    但感觉很怪 ,你这样的方式 不错 ,只是有一个问题,
    怎么传递参数呢 如 ids

    =============================================
    传递参数已经解决,代码如下

    instance.my_sample.btn_start = function(parent, action){<br />&nbsp; &nbsp; &nbsp; &nbsp; var self = this;<br />&nbsp; &nbsp; &nbsp; &nbsp; //id<br />&nbsp; &nbsp; &nbsp; &nbsp; action.context.active_id<br />&nbsp; &nbsp; &nbsp; &nbsp; //ids<br />&nbsp; &nbsp; &nbsp; &nbsp; action.context.active_ids<br />&nbsp; &nbsp; &nbsp; &nbsp; //_name<br />&nbsp; &nbsp; &nbsp; &nbsp; action.context.active_model<br />&nbsp; &nbsp; &nbsp; &nbsp; // 更多参数 请查看相关文档 或 用js调试 自行发掘<br />&nbsp; &nbsp; &nbsp; &nbsp; alert(&#039;test&#039;);<br />&nbsp; &nbsp; &nbsp; &nbsp; // and do something...<br />&nbsp; &nbsp; &nbsp; &nbsp; return false;<br />&nbsp; &nbsp; };
    


    =============================================
    自定义参数 传递方式 :

    <br />def act_start(self, cr, uid, ids, context=None):<br />&nbsp; &nbsp; &nbsp; &nbsp; context={}<br />&nbsp; &nbsp; &nbsp; &nbsp; context[&quot;key&quot;]=&quot;value&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; ret = {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#039;type&#039;: &#039;ir.actions.client&#039;,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#039;tag&#039;: &#039;lcd_video.btnPerview&#039;,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#039;context&#039;:context,<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; return ret<br />
    

  • OPENERP 时分秒
    L l315276651

    ;D 我也遇到相同的问题,字段类型换成 datetime  会显示时分 而秒是不会显示的 ,需要设置 datetimepicker 的 showSecond 为 true


  • OpenErp 加载外部JS文件
    L l315276651

    最近在研究OE的 web模块,
    想在OE中引用外网的JS文件
    直接在 openerp.py 的
    JS:[] 里面写吗? 据我所知
    OE的请求都是经过代理
    这样写会有问题吗?


  • Openerp web资源引用
    L l315276651

    最近在研究openerp的web模块,想在OE中 嵌入 百度地图,
    而地图的核心js文件是外部文件 如何引用?


  • 关于openerp中create的不解
    L l315276651

    感谢mrshelly和Joshua 2位大大的回复
    让我进一步的了解了OE
    继续学习OE 支持OE ;D


  • 关于openerp中create的不解
    L l315276651

    [quote author=mrshelly link=topic=6716.msg16026#msg16026 date=1369966522]
    嗯. 问题就在这里.

    你不应该到本身这个对象的 form view

    而应该是一个 wizard (osv.osv_memory || osv.Model) 内存对象...
    [/quote]
    有点不明白  不知道 源码中 有相应的demo吗?


  • 关于openerp中create的不解
    L l315276651

    [quote author=mrshelly link=topic=6716.msg16016#msg16016 date=1369955570]
    [quote author=l315276651 link=topic=6716.msg16007#msg16007 date=1369880356]
    [quote author=mrshelly link=topic=6716.msg16000#msg16000 date=1369834010]
    你的循环没有用对....
    [/quote]
    没用对?但我的数据已经全部写入oe了啊
    [/quote]

    数据已写入, 也不表明你的循环就正确啊.

    如果你的循环多运行了一次. 你想想后果是什么样子的?

    五条记录, 你想象中 应该是循环五次, 每次插入一条记录,
    但是,如果你的循环用错了. 你循环里的代码运行了六次. 那结果会如何呢? 当然, 这只是假设. 😄
    [/quote]
    可以确认的是 循环没有问题 每写一次数据我都print 出来写入的数据。现在的问题点是 在我开始循环写入数据之前
    OE就自动的帮我写入了一条数据,这条数据就是在tree页面 点击create后自动产生的,点击button后 oe会先写入这条
    数据 然后才执行我的function ,我猜测 这是oe的一种机制。不知道有什么办法 可以屏蔽系统自动创建的数据

  • 登录

  • 没有帐号? 注册

  • 登录或注册以进行搜索。
  • 第一个帖子
    最后一个帖子
0
  • 版块
  • 标签
  • 热门
  • 用户
  • 群组