mirror of
https://github.com/odoo/documentation.git
synced 2026-01-04 10:46:04 +07:00
[FIX] *: RST cleanup
RST cleanup to comply with the RST guidelines. This is required so we can use "make test", as there are currently hundreds of errors. For now, it is unusable because of the oldest code in this repo. closes odoo/documentation#3568 Signed-off-by: Castillo Jonathan (jcs) <jcs@odoo.com>
This commit is contained in:
@@ -408,7 +408,7 @@ how the POS interface works.
|
||||
.. _reference/actions/cron:
|
||||
|
||||
Automated Actions (``ir.cron``)
|
||||
======================================
|
||||
===============================
|
||||
|
||||
Actions triggered automatically on a predefined frequency.
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ following attributes:
|
||||
Requires an :term:`external id`, defaults to ``True``.
|
||||
|
||||
``field``
|
||||
----------
|
||||
---------
|
||||
|
||||
Each record can be composed of ``field`` tags, defining values to set when
|
||||
creating the record. A ``record`` with no ``field`` will use all default
|
||||
|
||||
@@ -20,7 +20,7 @@ Messaging integration
|
||||
---------------------
|
||||
|
||||
Basic messaging system
|
||||
''''''''''''''''''''''
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Integrating messaging features to your model is extremely easy. Simply inheriting
|
||||
the ``mail.thread`` model and adding the messaging fields (and their appropriate
|
||||
@@ -192,9 +192,8 @@ a date or an e-mail address, add CC's addresses as followers, etc.).
|
||||
:return: True
|
||||
:rtype: bool
|
||||
|
||||
|
||||
Logging changes
|
||||
'''''''''''''''
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
The ``mail`` module adds a powerful tracking system on fields, allowing you
|
||||
to log changes to specific fields in the record's chatter. To add tracking
|
||||
@@ -221,9 +220,8 @@ to a field, simple set the tracking attribute to True.
|
||||
well to give more context about the notification (even if the name did not
|
||||
change).
|
||||
|
||||
|
||||
Subtypes
|
||||
''''''''
|
||||
~~~~~~~~
|
||||
|
||||
Subtypes give you more granular control over messages. Subtypes act as a classification
|
||||
system for notifications, allowing subscribers to a document to customize the
|
||||
@@ -318,9 +316,8 @@ can override the ``_track_subtype()`` function:
|
||||
return self.env.ref('my_module.mt_state_change')
|
||||
return super(BusinessTrip, self)._track_subtype(init_values)
|
||||
|
||||
|
||||
Customizing notifications
|
||||
'''''''''''''''''''''''''
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
When sending notifications to followers, it can be quite useful to add buttons in
|
||||
the template to allow quick actions directly from the e-mail. Even a simple button
|
||||
@@ -469,7 +466,7 @@ The urls in the actions list can be generated automatically by calling the
|
||||
that can sometimes be boring, I choose the former instead of the latter.
|
||||
|
||||
Overriding defaults
|
||||
'''''''''''''''''''
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
There are several ways you can customize the behaviour of ``mail.thread`` models,
|
||||
including (but not limited to):
|
||||
@@ -510,7 +507,7 @@ the outside, allowing users or customers to quickly create records in your
|
||||
database without needing to connect to Odoo directly.
|
||||
|
||||
Aliases vs. Incoming Mail Gateway
|
||||
'''''''''''''''''''''''''''''''''
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Some people use the Incoming Mail Gateway for this same purpose. You still need
|
||||
a correctly configured mail gateway to use aliases, however a single
|
||||
@@ -531,7 +528,7 @@ Aliases have several advantages over Mail Gateways:
|
||||
|
||||
|
||||
Alias support integration
|
||||
'''''''''''''''''''''''''
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Aliases are usually configured on a parent model which will then create specific
|
||||
record when contacted by e-mail. For example, Project have aliases to create tasks
|
||||
@@ -977,7 +974,7 @@ The rating mixin allows sending email to ask for customer rating, automatic
|
||||
transitioning in a kanban processes and aggregating statistics on your ratings.
|
||||
|
||||
Adding rating on your model
|
||||
'''''''''''''''''''''''''''
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
To add rating support, simply inherit the ``rating.mixin`` model:
|
||||
|
||||
@@ -1010,7 +1007,7 @@ The behaviour of the mixin adapts to your model:
|
||||
``mail.thread``)
|
||||
|
||||
Send rating requests by e-mail
|
||||
''''''''''''''''''''''''''''''
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
If you wish to send emails to request a rating, simply generate an e-mail with
|
||||
links to the rating object. A very basic email template could look like this:
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
.. _reference/orm:
|
||||
|
||||
=======
|
||||
@@ -150,7 +149,7 @@ Advanced Fields
|
||||
.. _reference/fields/date:
|
||||
|
||||
Date(time) Fields
|
||||
'''''''''''''''''
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
:class:`Dates <odoo.fields.Date>` and :class:`Datetimes <odoo.fields.Datetime>`
|
||||
are very important fields in any kind of business application.
|
||||
@@ -211,7 +210,7 @@ These helpers are also available by importing `odoo.tools.date_utils`.
|
||||
.. _reference/fields/relational:
|
||||
|
||||
Relational Fields
|
||||
'''''''''''''''''
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. autoclass:: Many2one()
|
||||
|
||||
@@ -225,7 +224,7 @@ Relational Fields
|
||||
:member-order: bysource
|
||||
|
||||
Pseudo-relational fields
|
||||
''''''''''''''''''''''''
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. autoclass:: Reference()
|
||||
|
||||
@@ -234,7 +233,7 @@ Pseudo-relational fields
|
||||
.. _reference/fields/compute:
|
||||
|
||||
Computed Fields
|
||||
'''''''''''''''
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
Fields can be computed (instead of read straight from the database) using the
|
||||
``compute`` parameter. **It must assign the computed value to the field**. If
|
||||
@@ -325,7 +324,7 @@ it uses the values of other *fields*, it should specify those fields using
|
||||
.. _reference/fields/related:
|
||||
|
||||
Related fields
|
||||
''''''''''''''
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
A special case of computed fields are *related* (proxy) fields, which provide
|
||||
the value of a sub-field on the current record. They are defined by setting
|
||||
@@ -405,7 +404,7 @@ Automatic fields
|
||||
.. _reference/fields/automatic/log_access:
|
||||
|
||||
Access Log fields
|
||||
'''''''''''''''''
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
These fields are automatically set and updated if
|
||||
:attr:`~odoo.models.BaseModel._log_access` is enabled. It can be
|
||||
@@ -461,10 +460,10 @@ behavior is desired:
|
||||
:class:`~odoo.fields.Boolean`
|
||||
|
||||
.. .. attribute:: sequence
|
||||
..
|
||||
|
||||
.. Alterable ordering criteria, allows drag-and-drop reordering of models
|
||||
.. in list views.
|
||||
..
|
||||
|
||||
.. :class:`~odoo.fields.Integer`
|
||||
|
||||
.. attribute:: state
|
||||
@@ -769,7 +768,7 @@ Search/Read
|
||||
.. automethod:: Model.read_group
|
||||
|
||||
Fields/Views
|
||||
''''''''''''
|
||||
~~~~~~~~~~~~
|
||||
|
||||
.. automethod:: Model.fields_get
|
||||
|
||||
@@ -778,7 +777,7 @@ Fields/Views
|
||||
.. _reference/orm/domains:
|
||||
|
||||
Search domains
|
||||
''''''''''''''
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
A domain is a list of criteria, each criterion being a triple (either a
|
||||
``list`` or a ``tuple``) of ``(field_name, operator, value)`` where:
|
||||
@@ -940,14 +939,14 @@ Recordsets therefore provide the following operations returning recordsets thems
|
||||
(when possible):
|
||||
|
||||
Filter
|
||||
''''''
|
||||
~~~~~~
|
||||
|
||||
.. automethod:: Model.filtered
|
||||
|
||||
.. automethod:: Model.filtered_domain
|
||||
|
||||
Map
|
||||
'''
|
||||
~~~
|
||||
|
||||
.. automethod:: Model.mapped
|
||||
|
||||
@@ -962,7 +961,7 @@ Map
|
||||
records.partner_id.mapped('name') # == records.mapped('partner_id.name')
|
||||
|
||||
Sort
|
||||
''''
|
||||
~~~~
|
||||
|
||||
.. automethod:: Model.sorted
|
||||
|
||||
|
||||
@@ -164,6 +164,7 @@ More parameters can be passed as a query string
|
||||
|
||||
Useful Remarks
|
||||
--------------
|
||||
|
||||
* Twitter Bootstrap and FontAwesome classes can be used in your report
|
||||
template
|
||||
* Local CSS can be put directly in the template
|
||||
@@ -277,6 +278,7 @@ the template, such as data from additional models:
|
||||
|
||||
Custom fonts
|
||||
============
|
||||
|
||||
If you want to use custom fonts you will need to add your custom font and the related less/CSS to the ``web.reports_assets_common`` assets bundle.
|
||||
Adding your custom font(s) to ``web.assets_common`` or ``web.assets_backend`` will not make your font available in QWeb reports.
|
||||
|
||||
|
||||
@@ -225,6 +225,7 @@ properly.
|
||||
|
||||
Bypassing the ORM
|
||||
-----------------
|
||||
|
||||
You should never use the database cursor directly when the ORM can do the same
|
||||
thing! By doing so you are bypassing all the ORM features, possibly the
|
||||
automated behaviours like translations, invalidation of fields, ``active``,
|
||||
@@ -250,6 +251,7 @@ less secure.
|
||||
|
||||
SQL injections
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
Care must be taken not to introduce SQL injections vulnerabilities when using
|
||||
manual SQL queries. The vulnerability is present when user input is either
|
||||
incorrectly filtered or badly quoted, allowing an attacker to introduce
|
||||
@@ -420,6 +422,7 @@ likely it is to break things.
|
||||
|
||||
Evaluating content
|
||||
------------------
|
||||
|
||||
Some may want to ``eval`` to parse user provided content. Using ``eval`` should
|
||||
be avoided at all cost. A safer, sandboxed, method :class:`~odoo.tools.safe_eval`
|
||||
can be used instead but still gives tremendous capabilities to the user running
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
|
||||
.. _reference/testing:
|
||||
|
||||
|
||||
===============
|
||||
============
|
||||
Testing Odoo
|
||||
===============
|
||||
============
|
||||
|
||||
There are many ways to test an application. In Odoo, we have three kinds of
|
||||
tests
|
||||
|
||||
Reference in New Issue
Block a user