odoo

Odoo12之创建Todo应用

北慕城南 提交于 2021-02-18 21:30:23
声明: 本教程基于 Ruter 老师的 [Odoo基础教程系列] ,Ruter老师教程的链接地址为: Odoo基础教程系列 。 本章内容总结 1.项目前置准备 2.创建模块,模块的简单配置 3.model模型及模块安装 4.创建菜单视图 5.添加应用到应用列表 6.创建任务列表视图。 项目初始准备 如果你的odoo环境还没有配合好的话,请参考我的另一篇文章: win10中odoo12环境配置 在配好环境之后,如果要启动项目,需要添加如下配置: 1.将odoo-bin文件放在odoo源码下,如果没有odoo-bin文件,可以将odoo源码下的一个odoo.py文件复制并更名为odoo-bin; 2.在 odoo源码/setup/odoo.conf中添加odoo配置,内容如下: 3.pycharm下项目启动配置,在绿色倒三角形旁边 4.在odoo源码的目录下创建一个myaddons文件夹,用来存放自己编写的odoo应用/模块,这里我的odoo源码是从gitee上下载的odoo12源码; 为了让odoo可以检索到我们自定义myaddons下的模块,我们要将myaddons的路径加入到模块检索路径下 在 odoo.conf 文件下添加如下配置: addons_path=E:\YifChanSoft\Odoo\OdooSave\odoo_gitee\odoo\addons,E:

How to create Customer programmatically?

左心房为你撑大大i 提交于 2021-02-17 02:45:53
问题 I am using Odoo 13 and trying to create customer programmatically with the help of res.partner but unable to create customer. Contact is creating but as a individual not as a customer. But in Odoo 12 there is a binary field customer which differentiate other contacts from customer but it is not present in Odoo 13. Any suggestion or better idea and any help ? 回答1: The fields were removed completely in V13. With module/app account two new fields will be created: customer_rank and supplier_rank

odoo exceptions cachemiss error on update module with computed field

淺唱寂寞╮ 提交于 2021-02-11 14:47:39
问题 I update an odoo module after adding one field that should be computed, after restart the server it works fine but when add the field in the xml view file I receive this error odoo.exceptions.CacheMiss: ('rental.contract(13,).current_balance_amount', None) ... ... ... ValueError: Expected singleton: rental.contract(13, 16, 17, 18, 19, 20, 21, 22, 23, 24, Here is below the python code current_balance_amount = fields.Float(string='Current Balance Amount', default=0, compute='compute_rental

External API - XML/RPC - How to get the discount price - Odoo V14

陌路散爱 提交于 2021-02-11 13:33:52
问题 For our (personal) webshop I need to get the product discount price using the pricelist linked to a company . I manage to get the fixed price from a pricelist but when I change the Price Computation from " Fixed price " to " Percentage (discount) " it returns an error. I'm using the external API (XML-RPC) in combination with PHP. https://www.odoo.com/documentation/master/webservices/odoo.html Odoo 14.0+e (Enterprise Edition). My code: return $models->execute_kw($db, $uid, $pw, 'product

External API - XML/RPC - How to get the discount price - Odoo V14

僤鯓⒐⒋嵵緔 提交于 2021-02-11 13:32:03
问题 For our (personal) webshop I need to get the product discount price using the pricelist linked to a company . I manage to get the fixed price from a pricelist but when I change the Price Computation from " Fixed price " to " Percentage (discount) " it returns an error. I'm using the external API (XML-RPC) in combination with PHP. https://www.odoo.com/documentation/master/webservices/odoo.html Odoo 14.0+e (Enterprise Edition). My code: return $models->execute_kw($db, $uid, $pw, 'product

How to fix ValueError: Field `active` does not exist in odoo

瘦欲@ 提交于 2021-02-11 13:07:45
问题 I have a view which inherits from view employee form, with fields from a model I created, but whenever I try to upgrade the module it shows me the ValueError: Field active does not exist error. Here is the view from which I inherited the employee form. <record model="ir.ui.view" id="training_log_employee_form_inherit"> <field name="name">training.log.employee.form.inherit</field> <field name="model">training.log.emp</field> <field name="inherit_id" ref="hr.view_employee_form"/> <field name=

How to get specific record in json controller in Odoo 12

吃可爱长大的小学妹 提交于 2021-02-11 13:00:11
问题 My question says it all. I already did a controller to search all records from specific model. Now I want to search just one record (by its id) from the same model. My controller for all records is this: @http.route('/get_sales', type='json', auth='user') def get_sales(self): sales_rec = request.env['sale.order'].search([]) sales = [] for rec in sales_rec: vals = { 'id': rec.id, 'name': rec.name, 'partner_id': rec.partner_id, } sales.append(vals) data = {'status': 200, 'response': sales,

How to get specific record in json controller in Odoo 12

久未见 提交于 2021-02-11 12:56:59
问题 My question says it all. I already did a controller to search all records from specific model. Now I want to search just one record (by its id) from the same model. My controller for all records is this: @http.route('/get_sales', type='json', auth='user') def get_sales(self): sales_rec = request.env['sale.order'].search([]) sales = [] for rec in sales_rec: vals = { 'id': rec.id, 'name': rec.name, 'partner_id': rec.partner_id, } sales.append(vals) data = {'status': 200, 'response': sales,

Odoo: how to search a parent_id and its all child in product.category

我与影子孤独终老i 提交于 2021-02-11 12:41:52
问题 I want to, when the user selected (through Many2one field) a category, I need to find its related parent_id for Brands to add a domain filter on another Many2one field to have related child entries of these Brands. As I am beginner I failed to how to do this. Suppose Many2one field category_id here, user will select a category from first three entries, now we know that user wants to add an Electronics related item then system should populate Many2one field brand_id on Electronics related

How to send mail automatically while creating new vendor bill or customer invoice in odoo

喜你入骨 提交于 2021-02-11 12:28:57
问题 Hello everyone I have a custom accounting module inherits from odoo accounting module. I have created a budget and a budget has someone responsible for, and an analytic account related to this budget. I want to create vendor bills and customer invoices based on an analytic account related to the specific budget and I want to send an email notification message to the person responsible for the budget in his email when I create a new bill or invoice to notify him that with a message ( new bill