Skip to Content

Articles quick search and use FAQ


How to show articles for a definite document type, e.g. sales order or helpdesk ticket?

Create a new tag (e.g. 'odoo / helpdesk'). In the table 'Applied to' use a required model (e.g. 'helpdesk ticket') or use it for all documents (the check box 'Apply to all documents'). As advanced option you can apply filters: for example, to show articles only for 'new' tickets, not for 'in progress' ones

Assign this tag for required articles (for a few articles use the mass action)

Now when you access a quick article search from a document, this tag(s) would be set by default, and articles search is limited by this document type / domain

How to add an article in Odoo message?

Turn on the setting 'Articles in Email Composers'

Create a new tag (e.g. 'odoo / helpdesk'). In the table 'Applied to' use a required model (e.g. 'helpdesk ticket') or use it for all documents (the check box 'Apply to all documents'). As advanced option you can apply filters: for example, to show articles only for 'new' tickets, not for 'in progress' ones

Assign this tag for required articles (for a few articles use the mass action 'Mass update')

Go to the discussion under instance of this document type, press the button 'Send message', open 'Full composer' (arrows in the bottom right corner)

Push the button 'knowsystem' in a message editor, select required article(s)

Choose an action: to update message body with article contents, to attach a PDF version, to share a public url



RecordSet Operations


record in recset1 # include
record not in recset1 # not include
recset1 + recset2 # extend
recset1 | recset2 # union
recset1 & recset2 # intersect
recset1 - recset2 # difference

@api.constrains: constrains on Python level


@api.constrains('ir_actions_server_ids')
def _check_ir_actions_server_ids(self):
"""
Constraint to choose actions only for templates
"""
for config in self:
not_temp = config.ir_actions_server_ids.filtered(lambda action: action.model_id.model != "product.template")
if not_temp:
raise UserError(_('One of the actions you selected does not relate to product template. Please fix'))

Illustration: real code example





I installed KnowSystem but I do not see the button 'create' and other buttons


Most probably you haven't granted KnowSystem rights for your user. Choose the right 'KnowSystem Editor' or 'KnowSystem Admin' refresh a page. The control buttons should be now shown


How can I embed another website page to an article


To that end, you may use iframes. Switch an article to the raw HTML code editor and insert, for example:

<iframe src="https://faotools.com" style="width:100%;min-height:600px;"> </iframe>

 As a result you would get:


Check whether model has attribute


if hasattr(MODEL, ATTR): 
​​# do something
​​pass

Model - object, e.g. self.env["sale.order"]

Attr - field or method name, e.g. "active", "name_get"


V.19 migration


Security

  • Intermediate level res.groups.privilege is between ir.module.category and res.groups
  • res.groups field "users" is changed to "user_ids", so all security.xml files should be amended
  • res.users field "groups_id" is changed to "group_ids"
  • res.groups gets a new field "privilege_id"
  • Ir.actions.server, ir.actions.act_window, ir.ui.menu groups_id is renamed to group_ids

XML

  • ir.actions.act_window field "target" doesn't have "inline" value anymore
  • type="edit" is deprecated for kanban actions >> use type="open"
  • search_view_id should use ref instead of eval
  • group in search view should not contain "expand" or "string"

Check all res.config.settings XML views!

Python

  • auto_join - deprecated
  • from odoo.osv.expression import OR (AND) deprecated ==> from odoo.fields import Domain    Domain.OR; Domain.AND
  • @api.returns is not used anymore
  • self._cr is obsolete ==> self.env.cr 


Articles quick search and use FAQ



RecordSet Operations



@api.constrains: constrains on Python level



How can I link articles between each other?



I installed KnowSystem but I do not see the button 'create' and other buttons



How can I embed another website page to an article



Check whether model has attribute



V.19 migration