Purpose of this commit is to continue to clean server actions, scheduled
actions and automated actions. Server actions hold code execution and
automated actions hold triggers and conditions.
This commit make automated action inherits from ir_actions_server.
Automated actions do not hold several server actions anymore. Instead
each new automated action creates its own server action holding the code
or actions to perform. Automated actions that held several server actions
should now simply use a server action of type multi. This commit also
features:
* rename 'kind' field to trigger
* remove 'act_user_id' as this should be done by the server action itself
not the automated action. This can be achieved using a write or code
server action;
* remove 'act_followers' as this is replaced by a followers server action;
* use a primary form view inherited from server action. This way automated
actions use the same base form as server actions with triggers and
conditions added;
Thanks to @fpodoo for the original idea and preliminary work. Thanks to
@jpr-odoo for first developments. Thanks to @jem-odoo and @rco-odoo
for reviewing.
Purpose of this commit is to remove the link between Hr Contracts and
base automation. This has two consequences
* automated actions used to compute contracts state are transformed
into scheduled actions. Crons will do the job just as fine;
* option to use employee contract in automated actions is removed
and put in its own bridge module;
This allows to remove the dependency between the two addons.
CRM module depends on base automation only to have some automated
actions as demo data. To avoid having unnecessary dependencies
automated action demo data have been removed. This allows to remove
the dependency between CRM and base automation.
First step towards cleaning and improving automated actions is to
correctly name things. base_action_rule module is therefore renamed
to base_automation. Model is also renamed to base.automation.
The purpose of this commit is to handle code execution only in server
action and delegate schedule management to ir_cron model.
ir.cron model now inherits from ir.actions.server. Fields model, function
and args are removed as well as the logic to handle them. There is no
more code manipulation and evaluation in ir_cron, only a call to the run
method of ir.actions.server.
Cron form view use server action form view as primary view. This way
automated actions use the same base form as server actions with
cron details added.
Thanks to @fpodoo for the original idea and preliminary work. Thanks to
@jpr-odoo for first developments. Thanks to @jem-odoo for reviewing.
Main idea of this commit is to simplify the various options of
ir.actions.server model. Purpose is to make it a simple tool to
execute some actions or python code. This has two main consequences
* create and update server actions are simplified to update only the
current record. Complex options can always be achieved by python code
instead of error-prone option building mechanism;
* condition of server actions is removed. If a condition is necessary it
can either be included in a code server action, or integrated in an
automated action;
This commit features :
* remove 'client_action' server action type. Indeed this can be achieved
with a code server action returning an action;
* remove 'condition' on ir_actions_server model. From now on conditions
and triggers are managed in server action code or using automated
or scheduled action;
* clean 'create and copy a record'. Create and link are the proposed
options. Copy of the record or of a selected record is removed. Link
is simplified by removing the parsed expression that allowed complex
path update. It is simpler to write code than write python-like
expression in char fields;
* remove 'use_write' options. It now simply updates a record;
* remove 'write_expression' as it is replaced by code actions;
* remove 'ref_object' not used anymore with the removal of "choose
a record";
* remove helper to build an expression not used anymore with the removal
of "write expression";
* remove object ID finder;
* removed template display when choosing an email template; just go
on the template if you want more details;
* refactor server action form view to reflect changes. It will be used
in future commits as base view for automated and scheduled actions;
* add 'sequence' in list view;
* add new 'usage' selection field allowing to distinguish which model
uses the server action. Indeed as server action will soon be used
in scheduled or automated actions having a clue about the usage
is always helpful;
Thanks to @fpodoo for the original idea and preliminary work. Thanks to
@jpr-odoo for first developments. Thanks to @jem-odoo and @rco-odoo
for reviewing.
This field is now informative only and not used through the codebase. As
an usage field could be defined on various inheriting ir.actions.*
models, let us remove it from the base model and give some freedom
to sub-models.
* use selection and selection_add to replace old indirection for state
field and ease code understanding
* update various strings and helps
* update Python code helper to match new API changes, notably model,
record and records being recordsets
Functional
==========
Sales teams become sales channels. Their dashboard cards now include a graph
displaying customizable data for managers (comparable to those in accounting).
By default, you now have the following sales channels (non-demo):
Direct Sales (with installation of crm or sale)
Sales Channel type: Sales
Works same as before, what's changed is:
- their cards display one big button directing to the start of their
workflow
- the links on the right-hand side have been reworked, and are only
displayed when there is at least one item requiring attention.
- 'More' tab remains unchanged.
Website (with installation of website_sale)
Sales Channel type: Website
Differences lies in the links displayed in the dashboard card:
- it displays abandoned carts, awaiting payments and payments to capture
Default Channel linked to all sales made from the eCommerce.
Point of Sale (with installation of sale and point_of_sale
-> auto-installs pos_sale)
Sales Channel type: Point of Sale
Linked to pos.configs and their pos.sessions and pos.orders.
- only links to their linked pos.config dashboard and open sessions
- can't use opportunities, lead or invoicing and can only display
pos.order data in the graph.
Default Channel linked to the default pos.config.
Technical
=========
- Add a channel type: sales, pos, website that have different actions/settings
- Add a graphs to the kanban cards in the sales/crm dashboard, configurable in
the form view in the new dashboard page.
- Rename sales teams to sales channels, rename and add default and demo sales
channels
- Change dashboard links depending on the channel type and add a related
computed fields on crm.team
- Rename strings and improve channel form view.
- Leads are now checked by default once activated for 'sales' type channels
- Disable checking "leads" without using "opportunities".
- Hide invoicing and invoicing target depending on channel type.
- Move currency_id to sales_team
Move the "dashboard_graph" widget to web.
It converts a Text field containing data to a graph. As it is a generic
widget, it can (and will) be used elsewhere.
* base_action_rule, gamification, mass_mailing
1) Create the independant DomainSelector widget
- Allow to build a prefix char domain
2) Replace old FieldCharDomain with a new FieldDomain which uses the
new DomainSelector widget
3) Create the independant ModelFieldSelector widget
- Allow to build a valid field chain for a specific model
(e.g 'partner_id.name' for a 'res.users')
- Used by DomainSelector widget
---
The DomainSelector widget uses a tree-like representation with
user-friendly buttons (ALL/ANY/+/-/...). Any domain can be built,
except those containing the "!" (not) operator or some operators
like "like", "child_of" (@see DomainSelector). However, if the
user enters these in the debug input, the widget can handle them.
Note: these widgets had to do unusual stuff the widget API does not
allow to handle efficiently right now but it will be adapted to the
new widget/field API in a further update.
Note2: the widgets also have possibility of other improvements like
supporting m2o input instantiation in DomainLeaf, etc.
---
This work is an adaptation of the original code made by @pga-odoo.
Because now the carrier id is set on all picking from the same
procurement group, we want to call the carrier API only when there are
some package with a packaging_id set on it.
We have moved the 'quant.package' view into a wizard, because it's
always used as a wizard, and and there was context trouble with the
'Save' button as a button with nale 'write' (the context was mixed with
the field, and there were two write action whan "Save button was
clicked.
First of all we restrict the domain, of the action that shows product
packagings, to only show the packagings having a 'product_id' which
means that they are 'Product packagings' and not 'delivery' or 'stock'
packagings.
We also add the field product packaging to the 'product.packaging' form
view to easily create product packagings from the product packaging tree
view.
The menu item showing product packaging types was stored in
'stock_quant_views.xml' instead of 'product_views.xml' which seems a
more appropriate location, because the related action, only use products
and packaging, and not quants.
When our warehouse is configured to work as 'pick -> pack -> ship'
only the last picking (ship) has the information of which carrier
is set for this delivery.
This is a problem, because we also need the information in the packing
zone, to put in a pack with the correct package type.
To fix this problem, instead of overriding the function 'action_confirm'
which put the 'carrier_id' only on the 'ship' location. We set the
'sale_order_id' on the procurement groups created from the sales
order, and propagate it to the picking through the stock moves
from the procurement group.
Currently, the packaging of products are set on product.template, which
will cause problem if we use vatiants and packaging.
So we move the packaging from product.product to have the possibility to
have different packaging on different product variant of the same
product template.
When you activate the use of products packaging in 'stock' module, it
doesn't change anything in the product view if the app 'purchase' is not
installed.
We have this problem because the insert of the product_packaing view in
the product_template form is done in 'purchase' module instead of
'product' module.
To fix this issue, we had to move the page 'Inventory' from 'stock'
moduile to 'product' module. And the group 'packaging' form 'purchase to
'product' module.
On the website settings, it was intended to have a link to the Sales Settings when sale_ebay is installed.
As there's no link between the website and sale_ebay modules and we didn't want to create a bridge module only for that, we decided to remove the link.
The warning in not coherent anymore and should be changed
The computed field `domain` was formerly read as the current user to evaluate
the rule's domain for the current user. As we restrict the access of `ir.rule`
to advanced users only, the computed field has no purpose anymore.
Remove unrestricted "read" access. To make code internally using `ir.model`
work, add a private method `_get` on `ir.model` to retrieve the record
corresponding to a model name, without access rights issue.
Change signature of method `get_authorized_fields` to make it use a model name
instead of a model id. This removes the necessity of a search on `ir.model`.
- in employee form view: separate "Status" group from "Attendance" group
- make "Attendance" group only visible to attendance officers
this also fixes the use_pin group that would everyone to view pins if enabled
- in employee kanban view, fix the removal of the attendance widget to display
the fa-user icon again, instead of a simple red dot. (commit c468cfdd69 )
- Print Badge report set as pdf instead of html
- Replace the 'Status' separator by 'Attendance' in HR Settings tab
- Add a new Stat button 'Attendance' and set icon as a last action of employee
- 'Manual Attendance' field should only be visible if 'Related User' field is set
- 'PIN' field should only be visible if in setting enabled
- 'Payslips' stat button not displayed if user has no access rights
- If no start/end dates selected then '-' will be removed on 'Trial Period Duration' field
- Rearrange fields on employee form's 'Contact Information'
[IMP] Various usability improvments on attendance and HR application
When a message is sent on the chatter and the call fails (for example
because of an internet connection failure), the message was still
cleared so the content was lost.
This change keep the same behavior for chat window and discuss, but
change the behavior in a chatter so the message is only cleared if the
rpc has passed.
closes#14759
opw-696971