Commit Graph
107241 Commits
Author SHA1 Message Date
Yannick Tivisse aedde9a46c [REF] base_automation: cleaning and refactoring
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.
2017-01-03 19:11:08 +01:00
Thibault Delavallée ab13808949 [REF] calendar: remove dependency to base automation
Indeed there is no need to have a dependency.
2017-01-03 19:11:08 +01:00
Thibault Delavallée b9c37e794b [IMP] hr_contract: remove dependency to base_automation
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.
2017-01-03 19:11:08 +01:00
Thibault Delavallée b03e810a88 [REM] crm: remove dependency to base_automation
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.
2017-01-03 19:11:07 +01:00
Yannick Tivisse 319a939339 [MOV] base_action_rule: rename and move base_action_rule to 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.
2017-01-03 19:11:07 +01:00
Thibault Delavallée 1c79c5ee30 [REF] ir_cron: make scheduled actions inherits from server actions
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.
2017-01-03 19:11:07 +01:00
Thibault Delavallée 870974effe [IMP] ir_actions, mail: add add_followers server action
Add a server action allowing to add followers, either partners or
channels, to documents.
2017-01-03 19:11:07 +01:00
Yannick Tivisse 8fa9f7d6d4 [REF] ir_actions: refactor and simplify ir.actions.server
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.
2017-01-03 19:11:06 +01:00
Thibault Delavallée 452a97d9d4 [REF] ir_actions: remove usage field
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.
2017-01-03 19:10:28 +01:00
Thibault Delavallée bcc0212bfb [IMP] ir_actions: perform small code cleaning
* 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
2017-01-03 19:10:28 +01:00
Denis Vermylen (dve) d8072e11bd [FIX] sale_crm: remove deprecated dependency to web_kanban_gauge 2017-01-03 19:04:34 +01:00
Denis Vermylen (dve) eed8a34686 [IMP] crm_*, sale_*: sales channel dashboard
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
2017-01-03 19:04:34 +01:00
Denis Vermylen (dve) b8e1a00808 [FIX] maintenance: remove useless domain attribute
The domain attribute doesn't work for type="action" buttons/links sadly,
remove it to avoid giving false hope to those looking for such a feature.
2017-01-03 19:04:34 +01:00
Denis Vermylen (dve) 309f1672c2 [MOV] account, web: move account widget to web
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.
2017-01-03 19:04:34 +01:00
qsm-odoo e3f99885ca [IMP] web, *: add new Domain and Field selection widgets
* 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.
2017-01-03 18:38:03 +01:00
Pierre Masereel be58a61717 [IMP] delivery: send only new package with packaging_id to carrier
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.
2017-01-03 17:53:37 +01:00
Pierre Masereel d744f8d912 [IMP] delivery: put in pack wizard
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.
2017-01-03 17:53:37 +01:00
Pierre Masereel 342fc0e4c2 [IMP] delivery: add menu item for delivery packaging
We now have a menu item to manage the different delivery packaging.
2017-01-03 17:53:37 +01:00
Pierre Masereel b3ffcdc7ea [IMP] product: improve product packagings management
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.
2017-01-03 17:53:36 +01:00
Pierre Masereel e2c8910526 [IMP] stock: move menu item to related view file
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.
2017-01-03 17:53:36 +01:00
Pierre Masereel 4689f59a25 [FIX] delivery: set carrier on all picking created by SO
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.
2017-01-03 17:53:36 +01:00
Pierre Masereel c4055299c3 [IMP] product: add field 'barcode' on packaging
We add a field allowing to set a barcode on the product packaging.
2017-01-03 17:53:36 +01:00
Pierre Masereel 796900feb7 [REF] product: move packaging_ids on product.product
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.
2017-01-03 17:53:36 +01:00
Pierre Masereel ba6bd1af9e [FIX] product: move view of product packaging to product module
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.
2017-01-03 17:53:36 +01:00
Yannick Tivisse 74c78f878a [FIX] website: Link to the latest version for documentation user pages 2017-01-03 17:07:02 +01:00
Yannick Tivisse 066d9d75df [FIX] website_sale: Rename warning message for eBay settings
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
2017-01-03 17:07:02 +01:00
Akash Bhavsar 79fd51b2a5 [IMP] base_setup: Improve the General Settings form view 2017-01-03 17:07:02 +01:00
Raphael Collet 80c46ee4fc [MERGE] base: tighten access rights of ir.* models 2017-01-03 16:53:49 +01:00
Raphael Collet 172a767e5f [IMP] base: tighten ir.rule access rights
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.
2017-01-03 16:52:50 +01:00
Raphael Collet 6453e4eb23 [IMP] base: tighten ir.model.data access rights 2017-01-03 16:52:50 +01:00
Raphael Collet 34c661111b [IMP] base, *: tighten ir.model.access access rights
In `website_crm_partner_assign`, remove duplicate ACLs and reorganize files.
2017-01-03 16:52:50 +01:00
Raphael Collet 4f230b2180 [IMP] base: tighten ir.model.relation access rights 2017-01-03 16:52:50 +01:00
Raphael Collet 73de86c768 [IMP] base: tighten ir.model.fields access rights 2017-01-03 16:52:49 +01:00
Raphael Collet 18f4711dce [IMP] base: tighten ir.model.constraint access rights 2017-01-03 16:52:49 +01:00
Raphael Collet 5d746d0ac6 [IMP] base, *: tighten ir.model access rights
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`.
2017-01-03 16:52:49 +01:00
Raphael Collet 1abd543f14 [IMP] base: tighten ir.filters access rights
Remove "full access" for all users, and add it to specific groups.
2017-01-03 16:52:49 +01:00
Raphael Collet d0ca2d115e [REF] ir_config_parameter: remove group_ids and simplify
Add `sudo()` to call `get_param` where necessary, and make the web client use a
controller instead of directly accessing parameters.
2017-01-03 16:52:49 +01:00
Raphael Collet 7543afb070 [IMP] base, *: tighten ir.config_parameter access rights
Add `base.group_system` on existing parameters:
 - `auth_signup.allow_uninvited`,
 - `auth_signup.reset_password`,
 - `auth_signup.template_user_id`,
 - `google_redirect_uri`,
 - `mail.bounce.alias`,
 - `mail.catchall.alias`,
 - `mail.catchall.domain`.
2017-01-03 16:52:49 +01:00
Raphael Collet b392426295 [IMP] sale: tighten ir.attachment access rights
The salesmen and sales managers should belong to `group_user`.
2017-01-03 16:52:49 +01:00
Raphael Collet 1539887ce2 [IMP] base: tighten ir.actions.* access rights
All users have read access on `ir.actions.server`.  Add `group_system` on some
fields to make server actions a bit more discrete about what they do.
2017-01-03 16:52:49 +01:00
Martin Trigaux 19fce206ac [I18N] port of 44a6366b to master 2017-01-03 16:39:22 +01:00
jeffery chen fan f89c4c2002 [FIX] mrp: typo in the error message
Closes #14854
2017-01-03 15:35:39 +01:00
Denis Vermylen (dve) 8203cdb9ff [IMP] hr_attendance: code cleanup 2017-01-03 13:53:30 +01:00
Denis Vermylen (dve) 287968e66e [IMP] hr_attendance: remove entered PIN if wrong
So you don't have to click on Clear before re-entering the PIN.
2017-01-03 13:53:30 +01:00
Denis Vermylen (dve) c60b2c6a14 [FIX] hr_attendance: fix display issues
- 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 )
2017-01-03 13:53:30 +01:00
hbh 158f779b46 [IMP] Various usability improvments on attendance and HR application,
- 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
2017-01-03 13:53:30 +01:00
hbh 8cfd857b82 [IMP] web: set right alignment for float values on grouped records 2017-01-03 13:53:30 +01:00
dut-odoo 6c38bdaf35 [IMP] purchase: Improve the settings form view 2017-01-03 11:46:52 +01:00
dbh 22b91872ec [IMP] mail: add delay of 500ms to display the canned responses 2017-01-03 10:37:29 +01:00
Nicolas Lempereur 5d0b928544 [IMP] mail: don't clear undelivered chatter message
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
2017-01-02 17:37:42 +01:00