- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我需要将采购订单类继承为两种类型。一种是针对产品只能出售的采购订单,另一种是针对产品只能购买的采购订单。
我试图将核心 purchase.order
对象继承到两个新的自定义对象中。但是它不起作用。
我的代码是
from osv import fields, osv
class purchase_order_saleok(osv.osv):
_inherit = 'purchase.order'
_name = 'purchase.order.saleok'
STATE_SELECTION = [
('draft', 'Draft PO'),
('pending', 'Pending'),
('sent', 'RFQ Sent'),
('confirmed', 'Waiting Approval'),
('approved', 'Confirmed'),
('except_picking', 'Shipping Exception'),
('except_invoice', 'Invoice Exception'),
('done', 'Ordered'),
('cancel', 'Cancelled')]
_columns = {
'state': fields.selection(
STATE_SELECTION,
'Status',
readonly=True,
help="The status of the purchase order or the quotation request. A quotation is a purchase order in a 'Draft' status. Then the order has to be confirmed by the user, the status switch to 'Confirmed'. Then the supplier must confirm the order to change the status to 'Approved'. When the purchase order is paid and received, the status becomes 'Done'. If a cancel action occurs in the invoice or in the reception of goods, the status becomes in exception.",
select=True
)
}
purchase_order_saleok()
class purchase_order_line_saleok(osv.osv):
_inherit = 'purchase.order.line'
_name = 'purchase.order.line.saleok'
purchase_order_line_saleok()
谁能帮帮我?
最佳答案
为了将这些表添加到数据库中,您必须重新启动服务器和模块(正如 Lukasz Puchala 所说)。您的代码应创建新表。
但我不明白你的第一个需求,你为什么不使用 sale.order 用于可以sold 的产品,和 purchase.order 可以购买的产品?
仅供引用:
您不需要创建 purchase.order.line.saleok(因为它永远不会被使用),因为您的 purchase.order.saleok 将保留其第一个 _fields 定义,它将创建标准的 purchase.order.line 而不是你 purchase.order.line.saleok (除非你覆盖字段 order_line, one2many,与purchase.order.line.saleok)。
关于python - 如何在openerp中多次继承一个类?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23235669/
我在 OpenERP 7 中开发了一个自定义模块,我的管理员用户只能看到这个模块。 1-如何让普通用户访问我的自定义模块? 2-解决此问题的步骤是什么。 请举一个详细的例子。 最佳答案 创建一个Sec
我在 OpenERP 7 中开发了一个自定义模块,我的管理员用户只能看到这个模块。 1-如何让普通用户访问我的自定义模块? 2-解决此问题的步骤是什么。 请举一个详细的例子。 最佳答案 创建一个Sec
我是 OpenERP 新手。我需要禁用一些菜单而不卸载添加菜单的模块。我尝试搜索要禁用其菜单的模块,然后删除所有搜索结果,结果却得到一个非常杂乱无章的菜单。请问我该如何实现?我只需要在菜单栏和主页上隐
有没有办法向在项目中分配任务的人发送电子邮件或在任务完成后向项目经理发送电子邮件? 我正在研究 OpenERP v6.1。 感谢您的回复 最佳答案 您可以覆盖按钮对象方法, obj_mail_
我正在使用 Odoo v.8。我想找出 Odoo 在哪里找到模块所在的信息,以加载它们。我知道文件 openerp-server.conf 中有一个变量 addons_path。我在其中找到变量的唯一
如何在 OpenERP 中创建看板 View ? developer book似乎没有关于新看板 View 的任何信息,而且我在 OpenERP forum 中没有看到任何有用的信息。 . 最佳答案
我在 openerp 中创建了一个新模块,现在我想为该模块提供安全性,因为我在模块文件夹中创建了一个名为“security”的文件夹,并在其中创建了一个 xml 文件和 ir.model.access
我知道 openerp 域中的运营商很少。我没有得到可用域的详细信息及其解释。特别是对于这些否定域。谁能告诉我详细 list ? 最佳答案 这给出了一个概述: 名单域名运营商:! (不是),| (或)
我想自定义报告文件名。 例如,当我下载一张发票时,我会有类似“Invoice.pdf”的文件名。我想要的是“invoice_number.pdf”之类的东西,但我不知道如何使用动态文件名? 最佳答案
我想将一些产品导入 odoo/openerp 用于销售点模块。但是我有一个名为“Chalet”的类别,在导入过程中找不到。在哪里可以找到产品类别的外部 ID? 这是我要导入的 .csv: Ex
我正在尝试从 OpenERP 的 web gui 和字段类型创建一个字段作为引用 第一,没有更好的引用文档 第二我想要的是,当有人选择该字段时,它应该提供另一个未发生的选择选项(尽管它提供了一些字段,
刚开始深入研究 OpenERP v7。以前在 v6.1 中,可以在每个表单的右侧轻松定义特定表单的默认值。例如,产品类型我需要将其设置为“Stockable Product”作为默认值而不是“Cons
我搜索并修改了一个简单的openerp自定义模块的源代码,我给出下面的代码 初始化 .py import sim 开瓶器 .py { 'name': 'Student Information Mana
OpenERP 和 Odoo 之间有什么区别。 我知道 Odoo(v8) 是 OpenERP(v7) 的最新版本 并解释一些关于 Odoo V9 的信息。这里的差异意味着 Odoo 中可用的所有附加功
如何在 OpenERP v7 中进行调试? 在以前的 OpenERP 版本中,它很容易调试。但是在最新版本中很难调试。 最佳答案 要在 eclipse 中调试 OpenERP+python 代码,请在
我正在尝试比较 OpenERP 和 Dynamics AX。有谁可以告诉我编程 OpenErp 和 Dynamics AX 时的区别?例如,我知道 Dynamics AX 中存在一个自定义层,并且所有
有人可以告诉我,根据记录的状态,我可以通过什么方式在具有特定颜色的 View 看板中显示项目。 我正在尝试这样的事情 但我查看了所有元素,而不仅仅是那些在“预定”中的元素。 谢谢 :) 最佳答案 如
我已经为用户创建了安全访问权限。创建后,我得到了如下图所示的 View 。 通过在 .csv 文件中授予权限,如 1、1、1、1,如下图所示。 我的问题是这个权限应该被带到前端。管理员可以向不同的用户
我想在修改记录时显示一个弹出窗口。更像是一个自定义验证对话框,用户将在最终保存之前在其中输入一些额外的数据。 我的问题是我无法显示带有“ir.actions.act_window”的弹出对话框。 我尝
如何在新选项卡上打开 url 链接而不是在单击按钮时在 OpenERP 中弹出? 最佳答案 在 V7 中,按住 Ctrl 键并单击大多数链接会按预期工作(即在新选项卡中打开链接)。 在 6.1 中,您
我是一名优秀的程序员,十分优秀!