Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMP] reference/cmdline: corrects spelling errors, improves explicitness, adds references to missing cmd line options, groups opts into alphabetized categories for easier reference, adds separation of concerns between cmd line and config file, adds reference to config file options... #12028

Closed
wants to merge 2 commits into from

Conversation

Projects
None yet
2 participants
@tesserB
Copy link
Contributor

commented May 12, 2016

Description of the issue/feature this PR addresses:

This pull request aims to improve upon the structure, readability, and completeness of the "Command-line interface: odoo.py" documentation.

Current behavior before PR:

N/A

Desired behavior after PR is merged:

I hope to make it even easier for new Odoo developers to get started, or to save more seasoned developers the hassle of referring to command.py.

I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Cody Kitterman

tesserB added some commits May 12, 2016

[IMP] reference/cmdline: corrects spelling errors, improves explicitn…
…ess, adds references to missing cmd-line options, groups opts into alphabetized categories for easier reference, enforces SoC between cmd-line and config file, adds reference to config file options...
@tesserB

This comment has been minimized.

Copy link
Contributor Author

commented May 12, 2016

@mart-e It's not ready to be merged, but was hoping for some input/guidance.
p.s. I apologize for crashing the party earlier.

@tesserB

This comment has been minimized.

Copy link
Contributor Author

commented May 21, 2016

@fhe-odoo Would you mind checking these out for me, man, and letting me know if this is something Odoo would be willing to work with? I know it needs further editing, but I've asked others for input on the structural changes, and I haven't heard a peep. I understand some of that—"'everyone' already knows this stuff"—but I would like to finish these up, and move on to more significant improvements.

@tesserB tesserB changed the title [IMP] reference/cmdline: corrects spelling errors, improves explicitness, adds references to missing cmd line options, groups opts into alphabetized categories for easier reference, enforces SoC between cmd line and config file, adds reference to config file options... [IMP] reference/cmdline: corrects spelling errors, improves explicitness, adds references to missing cmd line options, groups opts into alphabetized categories for easier reference, adds separation of concerns between cmd line and config file, adds reference to config file options... May 21, 2016


.. program:: odoo.py
.. note:: This section applies to those developing within

This comment has been minimized.

Copy link
@mart-e

mart-e May 23, 2016

Contributor

why the indentation? this makes a quote

This comment has been minimized.

Copy link
@tesserB

tesserB May 24, 2016

Author Contributor

Hah, where's that GIF of panda smashing the keyboard? (Something stupid I did at the last second, after a long day. I knew better too...) Will fix...


.. option:: --addons-path <directories>
Creating a Module Skeleton

This comment has been minimized.

Copy link
@mart-e

mart-e May 23, 2016

Contributor

scaffold is not something you will use very often, even when developing, no need to put it at the top of the page (more useful to get basics running commands)

This comment has been minimized.

Copy link
@tesserB

tesserB May 24, 2016

Author Contributor

Small section and so I thought to 'just get it out of the way'... You're right though... Will move to the very bottom...

if ``count`` is not 0 (the default), enables multiprocessing and sets up
the specified number of HTTP workers (sub-processes processing HTTP
and RPC requests).
.. note:: If you have experience with Django and it's "django-admin startproject"

This comment has been minimized.

Copy link
@mart-e

mart-e May 23, 2016

Contributor

probably more startapp than startproject and wrong indentation too

This comment has been minimized.

Copy link
@tesserB

tesserB May 24, 2016

Author Contributor

Of course...

@mart-e

This comment has been minimized.

Copy link
Contributor

commented May 23, 2016

Hi,

Thanks for the PR, I have added a few comments inline but a few general remarks:

  • Could you try to reduce your contributions to minimal commits, so it's easier to navigate through the diff (I am not sure if you just moved blocks or changed the content too)
  • this PR is for master, the published documentation is the 9.0 (at least until v10 is released). Except if your changes refers to features only available in 10, you can submit for 9 (but there is conflicts)
  • check the indentation of your blocks, not sure why you increased it on many sections but it makes everything looks like a quote
@mart-e

This comment has been minimized.

Copy link
Contributor

commented May 23, 2016

I have already merged the obvious spelling errors at 68c6a51

mart-e added a commit that referenced this pull request May 23, 2016

@tesserB

This comment has been minimized.

Copy link
Contributor Author

commented May 24, 2016

@mart-e

Could you try to reduce your contributions to minimal commits, so it's easier to navigate through the diff (I am not sure if you just moved blocks or changed the content too)

Definitely.

this PR is for master, the published documentation is the 9.0 (at least until v10 is released). Except if your changes refers to features only available in 10, you can submit for 9 (but there is conflicts).

I'm still trying to work out what goes where, exactly. (It could be said to be "purely cosmetic", for instance...)

I should have it finished on Friday-Saturday morning.

YasserRabee added a commit to YasserRabee/odoo that referenced this pull request May 28, 2016

sync with remote odoo (#1)
* [FIX] base: fetch mimetype on ir.attachment for binary fields

* [FIX] sale: Teams dashboard, sales to invoice count

From 9.0, a sales order to invoice is no longer a
sales order in the state `manual`, but with the
Invoice Status "to invoice".

Before this revision, the sales order to invoice
were simply not counted at all, and this
count always displayed 0.

opw-675919

* [FIX] mail: visibility rules for channel notifications

Avoid raising an access denied error for messages that
the user has indeed be notified about.

The issue arose when a message posted on a document inaccessible
to the user was notified to one of the channels the user
is subscribed to.

The access control logic on messages relies on 2 heuristics
to grant read access to a message:
 a. either the user was notified about the messages, by being
    a follower of the document, or a subscriber of a channel
    following the document (in that case the user can see the
    message but not the document)
 b. or the user has read access to the document on which the
    message is posted (in that case the user can see both
    the message and the document)

Case `a.` sometimes fail to match when a message got notified
to several channels including one the user was not subscribed
to. Depending on the order of the returned rows in the SQL
query, the "foreign" channels could shadow the channels of
the user, making `a.` a non-match.

If case `b.` did not match either, the user would have the
`read` access denied, even though the message was visible by
the `search()` method.

The fix explicitly makes case `a.` match if the user was
notified in *at least* one channel.
This was not done through a change of the SQL query ORDER,
for readability reasons.

* [FIX] base: fixes previous fix

In fix e248882, the previous elif statement prevented the
execution of the fix code. This fix fixes the fix.

* [FIX] hr_recruitment: no create on ir_attachment action

The "Resumes and Letters" action simply displays ir_attachments
linked to hr_applicant objects; but there is no default_res_model
in the context so no ir_attachment you create is actually
displayed in the kanban view.

Since the goal of this action is simply to display attachments
linked to applicants, it makes more sense to disable the create button
and to force people to upload resumes and cover letters through
the applicant record.

* [FIX] website_sale: log if no pricelist

The pricelist field is not a mandatory field on the partner. A default
value is usually defined for any new partner created. However, if the
pricelist is manually removed from the partner, errors (tracebacks) will
occur in the eCommerce when no pricelist is found.

We cannot make the field mandatory, as it could potentially break the
workflow of some users which are not using eCommerce. Therefore, we
simply log an error message to help debugging.

opw-673453

* [FIX] account_asset: asset_create

When creating assets from invoice lines, the system must check
that assets have not already been created for the related invoice.
If assets already exist then these assets have to be removed.

Used case:

- In the purchase journal, tick "allow canceling entries"
- On a supplier invoice line, set an asset category
- validate the invoice
- cancel the invoice
- set to draft
- validate the invoice

Before the fix: the asset is created twice.
After the fix: the asset is created once.

opw:674674

* [FIX] account_asset: asset_create

When creating assets from invoice lines, the system must check
that assets have not already been created for the related invoice.
If assets already exist then these assets have to be removed.

Used case:

- In the purchase journal, tick "allow canceling entries"
- On a supplier invoice line, set an asset category
- validate the invoice
- cancel the invoice
- set to draft
- validate the invoice

Before the fix: the asset is created twice.
After the fix: the asset is created once.

opw:674674

* [FIX] account_asset: Typo error

* [FIX] website_form: prevent users from crazy clicking

If the feedback of a form is too slow, people might be tempted to
click a second time, trigerring a second request. If, after that,
the result has not been received yet, the user might be tempted
to click a lot of time because he is angry at such slowness. This
behavior would trigger a record creation each time the user clicked
the submit button. This fix disables the button once it has been
clicked once, and re-enable it if the record could not be created,
which means that there was an error in the input and the user needs
to change the values and try again.

The button has been changed to a span to avoid the default browser
behavior to post the form when no function is bound on the send button.

* [FIX] crm_claim: access rights for portal user

The portal user is not allowed to read the crm.team model.

opw:673480

* [FIX] res: Creating a partner with an invoice contact

When creating a partner with company_type='person' and with an invoice
adress, the created partner must stay a person.
Now a partner which is not a comany can have an invoice address.
Fixes #11730

opw:675322

* [FIX] purchase: delete unnecessary PO line

In v8.0, when a procurement is cancelled and the quantity remaining on
the PO line is zero, the line is deleted. It was not the case anymore
after the Purchase refactoring.

opw-675493

* [FIX] calendar: correct search on mail.message and ir.attachment

Handle the case of immutable (tuple) domain leafs.

* [IMP] doc: simpler coding: utf-8

According to PEP-263, the -*- is just a variant "using formats recognized by
popular editors".

* [IMP] doc: add guidelines warning

To prevent huge chunk of modifications for styling reasons (e.g. mass PEP8
commits)

* [FIX] account_asset: asset_create

When creating assets from invoice lines, the system must check
that assets have not already been created for the related invoice.
If assets already exist then these assets have to be removed.

Used case:

- In the purchase journal, tick "allow canceling entries"
- On a supplier invoice line, set an asset category
- validate the invoice
- cancel the invoice
- set to draft
- validate the invoice

Before the fix: the asset is created twice.
After the fix: the asset is created once.

opw:674674

Note: This is a cherry-pick of commits 9d14230 and 58a5b5e

* [FIX] account: amount currency in journal items list view

In 8.0, the amount currency field was displayed
in the journal items list view
when choosing, thanks to the `quick add` widget,
a journal with a currency set.
Otherwise, if the journal had no currency set,
the column was not displayed.

It was done thanks to the key
"currency" passed in the context.

From 9.0, the `quick add` is no longer used,
and, due to that, the amount currency field
was no longer displayed in the journal items
list  view at all, despite if the journal
had a currency set or not.

In technical words, `currency` was
no longer passed in the context,
making the invisibility property
set with
`invisible="not context.get('currency',False)"`
useless.

As this widget is no longer used, there
is no other choice than either
always display the column, either never.

We choose to display it only if you have
the multi-currency group (as this is the case
in the journal item form view)

We also take the opportunity to move the column
next to the debit & credit column, this is more
meaningful.

opw-676059

* [FIX] tools: export translated fields not included in _columns

Non-stored new API computed fields are only defined in _fields
but not in _columns, and they were never exported within translation
files.

Closes #9081

* [IMP] payment_adyen: support autogenerated HMAC SHA-256 key

From v4.1.0 of the documentation (2015-06-29), the HMAC SHA-1 key is
deprecated. Indeed, it should be considered as a legacy option to
guarantee compatibility with older skins.

The HMAC SHA-256 key should be used instead, and moreover, it seems that
any new skin created does not support SHA-1 at all, even if the option
is available.

The merchant signature code is inspired from the documentation example.

Source: https://docs.adyen.com/developers/hpp-manual

Fixes #9786
opw-676081

* [FIX] mail: fix performance issue with large channels

When a user is subscribed to a channel with many messages,
the discuss initial rpc /mail/client_action can become very
slow (in production, the rpc took > 20s when subscribed to
the Community mailing list).  This is due to the query in
_get_message_unread, counting the number of unread messages.

This commit adds an index on the relation mail_channel_partner,
this allows postgres to perform only index lookups, and speeds
up the query by 2 order of magnitudes.

* [FIX] web: editable list, up/down navigation on m2o

The current behavior was allowing going on the previous row if the
user is at the start of an editable element and on the next row if the
user is at the end of an editable element. The problem was, we did not
want this behavior when the editable element is a select or m2o (as
the up and down input should open the select/m2o dropdown instead).

* [FIX] account: reconciled with forced `amount_currency`

This is possible to create bank statements
forcing the amount in the foreign currency,
along with the bank account currency, and therefore
to force the foreign currency rate.

In such a case, when reconciling the journal items,
the currency rate conversion must not be done
against the currency rates written in database,
in the rates records, at that date, but with
the rate that was forced in the bank statement.

opw-676048

* [FIX] crm: take contact information on customer creation on opp

Conflicts:
	addons/crm/crm_lead_view.xml

* [FIX] stock: default_get waits for a field list

And not a 2-item dict that does not crash by chance. Hooray for python.

* [FIX] payment_ogone: transaction code for alias AFU

The Automated File Upload (AFU) Ogone API requires a transaction code to be set,
either:
 - ATR for automated transactions
 - MTR for maintenance operations

The default is ATR and is used for submitting transactions in batch.
However, the server-to-server mode of payment_ogone only uses the AFU
API to create new credit card aliases, and not to process transactions.

Using the ATR transaction code requires the ATR feature to be available
in the Ogone Merchant account - a paying option that is otherwise
unused. Using MTR as the transaction code is sufficient for adding
aliases, and the corresponding feature (MTR) is available at no cost
in most Ogone Merchant Accounts.

References:
 - Ogone Advanced Batch:
    https://payment-services.ingenico.com/int/en/ogone/support/guides/integration%20guides/batch
 - Ogone Alias Management:
    https://payment-services.ingenico.com/int/en/ogone/support/guides/integration%20guides/alias/bulk-alias-management-via-batch

* [FIX] stock: missing picking_type_id field

The picking type is not defined on the stock move when a picking is
created manually. This can cause errors, for example in manufacturing: a
product sold in kit will not be replaced by its components.

opw-673741

* [FIX] sale: Invoicing several SO with same partner and different invoice address

When invoicing several SO with same partner and with different invoice address,
different invoices have to be created with each invoice address.

Used case:

-create a customer with two invoice addresses
-create a SO for this customer with the first address
-create a SO for this customer with the second address
-select the two SO in the SO tree view
-click on "Invoice Order"
-click on "Create and view invoices"

Results:

Before the fix: The two SO are merged in one invoice with the second
address.

After the fix: Two invoices are created, one for the first address and
one for the second address.

opw:675961

* [FIX] crm: remove lead kanban view

Since the crm refactoring in V9, the stages doesn't make sense anymore on a lead,
as this step is only to validate an opportunity. We should remove this view as it
is confusing in this case : If I create a stage on the opportunity form view,
it appears also on the lead kanban view. Other side effects can also be encountered.

* [FIX] fields: filter result of 2many related fields with related_sudo

When traversing relational fields as superuser, you end up with a recordset for
which only a subset is accessible to the current user.  An earlier fix to this
issue completely dropped the `related_sudo` feature; change its implementation
to keep the feature.

* [REF] account_bank_statement_import: small refactoring to make possible inheritance

* [FIX] fields: delay recomputations when setting a binary field in attachment

Setting a binary field stored in attachment may trigger recomputations on the
main record before all fields are set on that record.  This may cause access
errors if the record does not satisfy some access rule because of the fields
that are not set yet.

* [FIX] expression: fix missing results in direct search on many2many fields

This case corresponds to searches like `[(field, 'ilike', name)]` where `field`
is a many2many field.  The domain processing performs a `name_search` on the
field's comodel, then makes the relation match the returned record ids.

Problem: the call to `name_search` uses the default limit (100), and this makes
the search return less results than expected.  Make the search complete by
forcing `limit=None`.

* [FIX] expression: fix missing results in direct search on many2many fields

This case corresponds to searches like `[(field, 'ilike', name)]` where `field`
is a many2many field.  The domain processing performs a `name_search` on the
field's comodel, then makes the relation match the returned record ids.

Problem: the call to `name_search` uses the default limit (100), and this makes
the search return less results than expected.  Make the search complete by
forcing `limit=None`.

* [I18N] Update translation terms from Transifex

* [I18N] Update translation terms from Transifex

* [I18N] Update translation terms from Transifex

* [FIX] mail: composer: escape RegExp pattern

to prevent crashes if the user types, e.g. a \, when mentionning someone.

* [FIX] account: sequence_id field in account.journal

The sequence_id field can be seen in debug mode but it cannot
be edited.

opw:676223

* [FIX] account_bank_statement_import_ofx: multiple accounts

An OFX file can contain more than one account. Therefore, we need to
loop over all the included accounts, otherwise statements will be
missed.

opw-673814

* [FIX] sale_mrp, sale_stock: _get_anglo_saxon_price_unit with a kit

When a kit is set with a valuation = "real_time" and invoice_policy = "delivery",
the price unit of the kit computed for the Expense Account in the the journal of
entries must be the sum of the average price of each component of this kit.

Used case:

Create a kit001 with:
*General information:
   -Product Type=Stockable Product
   -Invoicing Policy=Delivered Quantities
   -Sale Price=100$
   -Cost Price=80$
*Inventory:
   -Route=Manufacture
   -Internal Category=All/Sealable
*its product category set with
   -Expense Account=210000 Cost of Goods Sold
   -Costing Method=Standard Price
   -Inventory Valuation=Perpetual(automated)
*a bom of two components child001 and child002

Create child001 with:
*General information:
   -Product Type=Stockable Product
   -Invoicing Policy=Delivered Quantities
   -Sale Price=100$
   -Cost Price=70$
*Inventory:
   -Route=Buy
   -Internal Category=All
*its product category set with
   -Expense Account=210000 Cost of Goods Sold
   -Costing Method=Real Price
   -Inventory Valuation=Perpetual(automated)

Create child002 with:
*General information:
   -Product Type=Stockable Product
   -Invoicing Policy=Delivered Quantities
   -Sale Price=100$
   -Cost Price=10$
*Inventory:
   -Route=Buy
   -Internal Category=All
*its product category set with
   -Expense Account=210000 Cost of Goods Sold
   -Costing Method=Real Price
   -Inventory Valuation=Perpetual(automated)

Create a SO with:
   -one line with the kit001

Confirm the SO

Validate the Delivery

Create and view the invoices
   -per invoicable lines(deduct down payments)

Validate the invoice

Result:

Before the fix: in the entry created for this invoice, the debit for the kit001 in Cost of Goods Sold
was equal to 70 instead of 80.

After the fix: the debit for the kit001 in Cost of Goods Sold
was equal to 80(the sum of the average price of each component of the kit001).

opw:674608

* [FIX] project: make copy overridable in v8 api

Without the proper decorator, the method is matched as `cr_ui_context`.
This is because the `guess` mechanism expects a name `res_id` instead of
`record_id`.
For stability reason it is better to add the decorator than modify the signature
of the method.
Closes #11735

* [CLA] update signature of initos

Changes due to changes in the legal form of the company
Closes #11759

* [FIX] website_sale: set invoice address

When the user has several addresses, the call to the onchange method
`onchange_partner_id` will overwrite the actual invoice address chosen.

opw-675935

* [I18N] Update translation terms from Transifex

Had a timeout on last sync

* [FIX] base: res.config default value on selection fields

Since 3d8f7c2f, res.config support selection fields to set groups and install
modules using a selection field instead of boolean.
While the `module_*` fields are correctly casted from boolean to integers, it
was not the case with `group_*` fields.

This commit forces the conversion to get the expected field format value.

Closes #10373

* [FIX] hr_holidays: mail notification on leave request confirm

The followers of the departments subscribed to the
`Leaves/Allocations Confirmed` are supposed to
receive a mail notification when an employee
confirms a leave request.

It was no longer the case since the below revision:
2be1dfc1ed7c9814cd3dbf4eb4cc95f842f738c2

This revision subscribes the followers of the department
following the `confirmed` subtype manually
,on the leave request confirmation, because
`message_auto_subscribe` only works on fields for which
the value is passed to the `create` or `write` methods,
it doesn't work for related/computed fields
This can be removed as soon as `department_id` on `hr.holidays` becomes a regular
fields or as soon as `message_auto_subscribe` works with related/computed fields.

opw-676521

* [FIX] point_of_sale: pass tax_ids to pos_config view

It's needed by the onchange on product_id. Without this the price will
be correctly computed by `onchange_product_id` but upon saving the
record tax_ids will be lost.

Closes #11875
Closes #11705
Closes #10378

* [FIX] product_expiry: 'product_id' in context

When creating a new lot from an incoming picking transfer, the product_id
is written in the context.

opw:674608

* [FIX] point_of_sale: display select button on client list after scanning

Before this, if you where on the customer selection screen and scanned a
customer barcode the customer would be shown, but you were not able to
select him.

This correctly sets ClientListScreenWidget.new_client to the scanned
partner which makes the button toggle.

Closes #11874

* [FIX] mail: escape author name in messaging menu

* [FIX] mail: messages sent as reply to previously selected message

In Discuss, if a message was selected as message to reply to, it wasn't reset
when switching to another channel. So if the user sent a message in that other
channel, the message was sent as reply to the previously selected message.

This rev. ensures to always unselect messages when switching between channels.

Closes #11879

* [FIX] account: SO reference in register payment wzd

Follow up of fix 6f8030a

This previous fix removed the reference field when creating an
invoice from a sales order since this field was for Supplier
Invoices (and is not shown for Customer Invoices).

While this males sense, it had the side effect of removing the
default value for the "Register Payment" wizard.

To keep this wizard populated with the most sensible data,
the default is now set to reference or name or number (in that
order).

opw 676261

* [FIX] sale_mrp: return of _get_anglo_saxon_price_unit

This function _get_anglo_saxon_price_unit must always return the price_unit.

* [FIX] base_action_rule: simplification typo in `make_unlink()`

* [FIX] mrp: avoid empty cost of produced product

If the production flow is in two steps:
1. consume raw material
2. produce manufactured product

The total_consume_moves was empty (so computed cost was 0)

Include the moves that were already consumed since the last production.
This will offer a correct estimation of cost of production in real time for
companies producing in several steps.

opw-675994

* [FIX] mrp: include workcenter cost in total cost

Estimate the workcenter cost based on produced quantity so far.
The workcenter cost is written on analytic accounts at the end of the production
only. A new method _compute_costs_from_production is needed to estimate the
workcenter total cost and then divide by the produced unit.

opw-675994

* [FIX] crm_partner_assign: Interested message subtype

When a partner tells he is interested or not by a lead,
the customer on the lead must not receive a mail
with this information.

opw-676729

* [FIX] website_project_issue: Issues visibility in frontend for portal users

The domain used to search the project issues in the website_project_issue
controller(['/my', '/my/home']) was useless thanks to the ir.rule portal_issue_rule

opw:676447

* [FIX] account: A negative amount with sale taxes on bank statement line must be considered as a refund. Courtesy of Adrien Peiffer (ACSONE). PR #11877

* [IMP] doc: add documentation of read_group

Has already a docstring but was not included

* [FIX] base: Changing a company contact in a company

When a company contact is changed in a company, this contact will
not be displayed as a company contact.

opw:673715

* [FIX] purchase: Context propagation in wkf_confirm_order.

Closes #11916

* [FIX] account_voucher: supplier voucher should list receivable accounts

opw-676508

* [FIX] project: falsy demo data

The author_id field is actually a res.partner, not a res.users.

In some cases, if the partner with id 1 is deleted, installing
project was impossible.

* [CLA] signature for Farrah Dickerson

Closes #11917

* [FIX] account: set reconciliation date as admin

The user performing reconciliations may not always
have the right to update the corresponding partners,
for example if a partner is also a system user.

Doing it as super-user after verifying that the
user is indeed allowed to reconcile journal items
works around the problem.

Fixes #11931

* [FIX] import: broken translation cache for absent translation of 'false'

Backport of 7d732b1011f577b12a1c2aac9ef205e633ab8f61

Fixes #979

* [FIX] website_sale_delivery: unset delivery line before update

When removing the last line (apart from the delivery line) from the
cart, it is necessary to remove the delivery line before updating
the cart; otherwise the carrier is contacted with a 0 weight order
and crashes.

* [IMP] product: order attribute by name

closes #11951
fixes #11602
opw-673857

* [I18N] Update translation terms from Transifex

* [I18N] Update translation terms from Transifex

* [FIX] web: raise a warning for bad domain

When a user wrote a wrong value in char_domain field it should raise a warning
message instead of a traceback.

opw:676783

* [FIX] project: Settings" in administration for a user

Used case:
-go as admin and set for the demo user the right "Settings" in administration
-connect as demo user, go in settings of project and untick the forecasts option and save

Result:
-Access rights error because the user has no rights to unlink records on "ir.values" model.

Fix:
When the user is in the group_system group, he has the rights to unlink records in "ir.values" model.

opw:676714

* [FIX] mail: rapid click on "New Message" cause error

If the "NEW MESSAGE" or "Log an internal note" are clicked succeedingly
too fast, we can get into a situation where the composer is init'ed but
have not already been start'ed.

closes #11952
opw-675973

* [FIX] account: account selection

When a user prints the GL of a given account, the GL of all accounts is
printed. On a production environment, this can generate thousands of
pages (and ultimately, a crash).

opw-676061

* [IMP] web: multi-click on save on view form (no fp)

When clicking on save several time when editing a view form it can be
saved several times which can be an issue for one to many.

The normal happenstance when saving should be as follow:

-> save (click)
-> wait write result
-> received write result
-> reload the form with updated data and updates buttons

But when clicking several time, it could become:

-> save (click)
-> wait write result
-> received write result
-> save (click)
-> wait write result
-> received write result
-> reload the form with updated data and updates buttons

This commit only reinstate the saving feature once the form is reloaded.

closes #11926
opw-671793

note: no need to forward-port

* [FIX] google_calendar: user invited to one recurring event occurence only

When a Google user was invited to one occurrence of a recurring event,
but not to the recurring event itself (and the other occurrences, therefore),
and the user owner of the recurring event did not sync his calendar in Odoo,
the event occurrence could not be synced in Odoo, because it attempted
to attach it to the parent/main recurring event, which was not present
in Odoo.

In such a case, Odoo now syncs the event occurrence as a simple classic
event. In addition, if the owner of the event sync his calendar with Odoo
afterwards, or if the user is invited later to the main/parent recurring event
and then sync again his calendar,
it then attach the event occurrence that was previously
synced to this main event, to avoid events duplication.

opw-676535

* [FIX] sale: uom conversion for invoiced quantities

When invoicing products from a SO, you may decide to change the uom
of the invoice (if you invoiced only  a fraction of the product, for
example). In that case, conversion is necessary to ensure that the
"invoiced quantity" field on the SO line is correct.

* [FIX] fields: invalidate x2many fields with a domain

Invalidate the cache of a x2many field when any of the fields appearing in its
domain is modified.  Use the invalidation triggers mechanism for that purpose.

* [FIX] sale: outdated .pot file

Was having content of website_quote

* [FIX] account_anglo_saxon: default account value

The default account value set for purchases invoices
lines for product of type Service was wrong: It used
the stock account, which is wrong as a Service
as no stock. Instead, it should left the product
expense account, as usual.

opw-676110

* [FIX] hr_holidays: date_from field

Wrong field date_from:month in model hr.holidays

opw:676837

* [FIX] account, account_asset, purchase, sale: deferred revenue type/ asset type

When creating an invoice from a SO or PO with a line containing a product with a
deferred revenue type or an asset type, this information is not copied in the
related invoice line.

Inspired from 564fda4
opw:677098

* [FIX] account_asset: deferred_revenue_category_id and asset_category_id

When creating an customer invoice with a product linked to a deferred revenue
category, the account used in the invoice line must be the account_asset_id.

When creating an vendor bill with a product linked to an asset
category, the account used in the invoice line must be the account_depreciation_id.

Inspired from 0287c1e1b34a14300dcf7ef9ffddf160b61631ee

opw:677098

* [FIX] web: search input of date

When the user searches for date (or a datetime) in the search bar, the
suggested date can become completely wrong. For example, in the French
localization where the date format is DD/MM/YYYY, the system will search
for the date MM/DD/YYYY. This is even worse when the date is not fully
written: DD/MM could be converted to MM/DD/0000, which doesn't make any
sense. This is related to the moment issue
https://github.com/moment/moment/issues/1407.

The fix is to make sure that the input date has a correct format thanks
to `parse_value`. The latter converts the date into a fixed format.

Fixes #11876
opw-676604

* [FIX] tools: keep comment in CSV export

The comments field was ignored (because reasons) when exporting terms in CSV.
This was an issue when using the wizard 'Synchronize Terms' as it first export
the terms of every module in CSV.

opw-673853

* [FIX] barcodes: also allow barcodes triggering buttons in dropdowns

On smaller screens some buttons will be hidden. An example of this is
the 'Validate' button in the stock.picking form view. It is not :visible
but it should still be possible to trigger through scanning a
'O-BTN.validate' barcode.

opw-676741

* [FIX] calendar: edition of events duration

In event not during all day, it looks like
`start_date` could be defined, but `stop_date` not.

Despite the fact this is not such a normal state, this should
not prevent the save of the event with the
`_check_closing_date` constraint, checking that the ending
date is after the starting date
(in the case of an event not during the whole day,
this is ensured with the `start_datetime` and the
`stop_datetime`

opw-676245

* [FIX] account payment difference sign

When a payment is registered on an invoice, the payment difference must
be considered differently if we receive the payment or pay a bill. This
is necessary at the creation of the 'Counterpart' entry. For example,
an invoice of 100 is considered as paid with a payment of 90. The
difference of 10 should be booked as a debit in case of a customer
invoice, but it should be booked as a credit in case of a vendor bill.

opw-675641

* [FIX] base: no-break space in qweb

A non-breaking space is used between the amount and the currency.
However, if a space is used as a separator, there is a possibility that
the amount will be split into several lines.

opw-674535

* [FIX] google_calendar: do not copy user Google info

If a user syncs his calendar with Google,
and a second user is created in the database by copying this first
user, the Google information of the first user was copied
(The Google account to sync, the token to use, the last
syncrhonization date, ...), which is obviously wrong.

On calendar syncrhonization, which can be done
manually or automatically with the according cron, all
events of the first user were created a second time,
as a second user synchronized the same Google Calendar.

opw-674141

* [FIX] http: clear environment/caches on transaction rollback

Backport of 8423a0df3482567b0e2f77852dda14b80a029401

Clear the cache/environment in addition to rolling back
the cursor, in order to retry the transaction with fresh
data, not partially stale data.

* [FIX] account: periods in general ledger report

When "Filter by Periods" is choosen in the wizard, the right periods
must be set in ctx to filter the account moves according to the right periods

opw:674593

* [FIX] account: print multiple GL

When several accounts are selected to print their GL, the GL of only one
is printed. This is due to two issues:
- 'active_id' is retrieved instead of 'active_ids'
- the method `get_action` is called with the wrong records. `self`
  refers to the wizard, not to the accounts selected.

opw-676061

* [FIX] account: endless loop in exchange rate entry creation on full reconciliation fixed. ticket 676467

* [IMP] point_of_sale: verbose logging when dealing with 'rescue' sessions

When dealing with issues related to 'rescue' sessions we are very
limited in what we can do because the actual orders sent to the backend
exist only in localStorage in the browser on the device of the
user. Because of this it is important that we log some data about the
orders we receive in the backend to have an idea of what's going on.

opw-676497

* [FIX] purchase: taxes from PO

If a user removes the taxes on a PO line, the product taxes will be
added back when the invoice is created.

opw-676858

* [FIX] account_asset: Depreciation Expense Account and Depreciation Asset Account

"Depreciation Account" must be renamed in "Depreciation Expense Account"
Reason: This is the account that will be shown in the Profit and Loss, the original
label "Depreciation Account" is confusing because it could mean a depreciation asset
account.

"Asset Account" must be renamed in "Depreciation Asset Account"
Reason: This makes it clear that this is an asset account that will receive
depreciation entries, without this wording it could mean that we are simply
informing the Asset module which account is the asset account, but that depreciation
entries go elsewhere.

opw:672852

* [FIX] mail: missing translation due to typo

Closes #11929
opw-676854

* [ADD] tools: Swiss German language

Closes #4722

* [ADD] tools: Burmese language

* [FIX] account: sort taxes before computation

Taxes should be sorted before computation, otherwise if some taxes
affect subsequent taxes, the computation will be wrong.

opw-676119

* [FIX] account: base field in account.invoice.tax

The field base is obligatory according to a european law.
This field existed in saas-6.

opw:674713

* [FIX] point_of_sale: use client validation date instead of creation date

9f541d29bf58c3604f6c834ba25e1625c9ad1480 made it so that date_order on
pos.order records is set using the creation_date of the clientside Order
record to avoid weird date_order values when syncing to the server is
not done immediately.

The downside of this approach is that creation_date is set during Order
creation on the client. A user that has an open POS will also have an
open order. So if it takes one hour before the first order can be made
then the date_order will reflect this.

To avoid this we will instead use a validation date, which will be set
when the user clicks on the green 'Validate' button.

Because this is a stable release we won't change the name of the key in
the JSON data that gets sent to the server. This means that from the
server point of view nothing changes.

Fixes #11933

* [FIX] sale: exact matching on origin

Avoid that an invoice for 'SO042' matches with the invoices of 'SO04'.
The use of the like is required as it may contains more than one reference to an
invoice.

opw-676921

* [FIX] account: print Trial Balance

This applies commits 313bc91cf509353e5bdf8bf684589475527df7be and
2ad4bd4846074c4e4334aff13e32cc3335657c73 to Trial Balance report.

opw-676061

* [FIX] stock: Reversing scrapped moves

When reversing stock moves by clicking on "Reverse" in stock.picking
form view, only the stock moves not scrapped must be reversed.

opw:672236

* [FIX] purchase: date planned

When a PO is copied, the date planned of the order lines should be
recomputed based on the order date.

opw-675480

* [FIX] purchase: date planned

When a PO is copied, the date planned of the order lines should be
recomputed based on the order date.

opw-675480

* [FIX] account: multi-currency reconciliation use case as defined in opw 640248. Since the reconciliation changed, the bugfix made for saas-6 isn't valid anymore and was actually, the root cause of the same bug appearing in v9.

* [FIX] product: respect sequence when loading pricelist rules

Fixes #11987
Close #11988
opw-676422

* [FIX] mail: remove unneeded call to `refresh()`

With new api, this call is not wanted anymore. The cache is cleared
automatically, no need to clear the whole cache; that's a little bit
overkill and reduce performances.

* [IMP] account: improve reconciliation speed

 - Only invalidate cache for fields and records we modify
 - Rewrite query to be more efficient
 - Avoid o2m commands to be more efficient; write directly on reverse m2o

* [IMP] models: mark records as recomputed as soon as they are

When recomputing stored function fields, the `write` may trigger a
cache invalidation which lead to a recompute of all the recordset
values, even the ones already saved in database.

* [FIX] payment_authorize: use state code instead of state name

The state given to authorize requests should be the state code and not
the state name.

source:
https://support.authorize.net/authkb/index?page=content&id=A1454&actp=RSS

opw-675634

* [FIX] purchase: fiscal position from onchange_partner_id

Used case:

-Configure admin as multi-company user
-Create 2 fiscal positions (one for company "Odoo BE" and one for company "Odoo US")
-Set admin on company "Odoo BE"
-On supplier (Asustek) configure fiscal position Odoo BE
-Set admin on company "Odoo US"
-On supplier (Asustek) configure fiscal position Odoo US
-Configure a product (Laptop E5023) with:
   *route "Buy"
   *supplier (Asustek) without company
   *reordering rules (min qty: 20, max qty: 40)
-Set admin on company "Odoo BE"
-Run scheduler via the cron

Behavior before the fix:

-Fiscal position on the created PO is the fiscal position for "Odoo BE" (and PO is for the company "Odoo US")

Behavior after the fix:

-Fiscal position on the create PO is the fiscal position for "Odoo US".

Closes #11537

opw:673288

* [IMP] account: invoice analysis pivot quantities

In the report "Invoice Analysis", the view under the report is grouping
lines by invoice and also by product on this invoice.

Thus, quantities in the pivot view are not the real quantity of invoice
lines, but of invoice lines with different products.

eg:

invoice a:
- line 1: product X
- line 2: product Y
- line 3: product X

in the report there would appear to only be 2 invoice line, whilst there
is in realy three (this information is accessible via "# of Lines").

closes #11954
opw-676651

* [FIX] website: URL of website_published is wrong when using next/previous

Steps to reproduce:

-go to runbot 8.0 and connect
-go into human ressources/job positions
-pass into list view and click on the first item
-click on the url to open this record into the website (website_published)
-go back (back into the browser)
-you're now into the form view again and then next step is to click on the button
"next" to access the following record
-click on the url of website_published

Before the fix:

wrong record, this is the previous one that is into the href

After the fix:

correct record with the correct id into the href

Closes #11800
opw:675832

* [FIX] web_editor: scroll and editing menu modal

The class modal-open on body tag allow to scroll on the modal content
which is useful if the content is taller than the window viewport.

When closing the modal, this class is removed but there may be another
modal open on which we will not be able to scroll to view
buttons/content if too big.

This commit check if a modal is still opened after closing an editor
modal and in the affirmative add back the modal-open class.

opw-674475

note : was already present in 8.0 with ec47493, it is also present for
web.Dialog (but the modal of the editor do not inherit from web.Dialog)

* [FIX] account_asset: correct dependencies of `amount_residual` field

Also use a `set()` to avoid processing assets multiple times when
creating moves from lines

* [FIX] l10n_fr: FIX default Sale/Purchase tax. Courtesy of alexis-via. PR #11139

* [FIX] web_editor: video - allow to add video from unknown source

There are not cat... but you cannot know all the existing website in the world...
So, have faith in the user !

To do: allow to customize size or get it from iframe provided

* [FIX] tools: correct Burmese locale

* Revert "[FIX] product: respect sequence when loading pricelist rules"

This reverts commit b0f02e31b2e46685927ba6bb099158b6a211b6ce.

As pointed out by @nim-odoo [1], a similar patch has already been
uncommited few month ago [2].

Ref #11988
opw-676422

[1] https://git.io/vrYxY
[2] see a6badd25597e5e0930cb014fe94db754dae32c8f

* [IMP] document: indexation of MS documents

Commit 3ced0ff61 removed the support of Microsoft documents for
indexation. It makes sense for the old formats such as '.doc' since it
requires an external tool ('antiword'), which could lead to a security
issue. However, the new formats such '.docx' are simple xml files,
therefore they could be indexed with the usual XML parsing tools.

opw-677235

* [FIX] setup: missing dep for RHEL-based distros

* [FIX] web_kanban: quick redrag of kanban records

When dropping a record, it is updated and rerendered. The problem with
this behaviour is that if the record is redrag immediately after drop,
jquery-ui throws an error as the widget the user is trying to re-move
is being rerendered.

The solution provided by this commit is to block the draggable feature
while the record is being rerendered.

* [FIX] setup: use hard tabs

GTFO

* [IMP] website: share widget and multi language

The lang of the content of the "Share" widget was the one used when
inserting  it in the view. Thus if someone see a page with it in another
language the title and url for sharing is not translated.

This commit use the current page language to set the widget data.

opw-676062

* [FIX] setup: atom doesn't want to use hard tabs even when told to

This is now the 2d stupidest commit I ever did

* [FIX] core: correct `fields.modified_draft` for triggers on other models

* [FIX] l10n_be_intrastat: get location_id from stock move

purchase.order have been rewritten with cb01be2

It was not taken into account for intrastat  who still used the now not
existing "location_id" on purchase order.

This commit use instead the method _get_destination_location which
should be equivalent.

opw-677497

* [FIX] l10n_be_intrastat: typo

* [I18N] Update translation terms from Transifex

* [I18N] Update translation terms from Transifex

* [IMP] doc: Enterprise-compatible installation instructions

Before this revision, the installation instructions where
Community-centric, which led some customers to believe
that they had to install first Community then Enterprise.

This commit makes the instruction compatible for both editions.

* [FIX] web: fix duplicate changes in form view

Before this commit, in some cases, clicking on 'save' button, then on
other buttons (like 'validate' in invoices) had the unfortunate effect
of applying twice the changes in some cases.

More specifically the problem appears when:
1. an onchange is triggered (for example, taxes in invoices)
2. the user clicks on 'save', buttons are disabled
3. the 'save' actions is completed, the buttons are enabled, but
   the on_button_save still does some work: triggering event, and
   reloading the view
4. the user clicks on 'validate'
5. the onchange completes, this triggers some more work

Our only protection against such interactions is right now the fact that
buttons are disabled/enabled.  In my opinion, there should be a way
to guarantee that actions are properly serialized (that is actually what
a mutex is for... just saying). But the code of the form view/list view is
too coupled, and such changes are quite dangerous.  A real refactoring
of those is needed at some point in the future.

* [FIX] web: remove useless line

the enable_button call should have been removed...

* [FIX] base: Add missing return values

The _auto_init method was overriden without keeping the return value of
the super on some models.
This break the new stored computed fields computation at field creation.

Closes #11985
opw-677232

* [CLA] signature for s.sokolko

* [FIX] web: update compatibility layer

this commit adds better support in the compatibility layer of the
js framework.  This is necessary if one wants to follow the
official tutorial.

* [FIX] point_of_sale: select correct journal

An issue occurs in the following situation. Several cash journal are
configured for a given PoS, and a user performs a refund (the
transaction contains only a refund). In this case, the wrong journal
might be selected. This is because a payment line of zero is not sent to
the backend, and therefore an arbitrary journal is selected.

opw-676229

* [FIX] l10n_fr_fec: intial balance of accounts from the P&L should be summarized into a single line

* [IMP] doc: uniform design with user documentation

Apply the same changes from functionnal documentation to dev doc:
odoo/documentation-user@4316470

* [IMP] web/database manager: admin login & country

Add inputs e-mail address and country
when creating a newdatabase

This will provide the installation of the correct
chart of accounts at the installation of Accounting

Use the provided login as the admin login,
and set the email on the partner
if the login set is an email

Set the country on the company (and its partner)
The countries are parsed from XML country list

We take the opportunity to repair the `label for`
which bind the label with the input only if
the `id` attribute of the input is set with
what is set in the `for` attribute of the label

* [FIX] website: backport of 613ee31f9c67179c4e13aa9a2dbcef6492da38d9

* [FIX] account: readonly bank statement line

Like in "view_bank_statement_form" when a line is linked to
a journal entry, this line must be in readonly.

opw:676344

* [FIX] account: usererror takes only one argument

opw-677589

* [FIX] web: Y-axis formatting

In case of a line graph, the values of the Y axis are not formatted as
numbers, although they are on the bar graph.

* [FIX] web: left margin of graph

The left margin of the graph doesn't take into account the width of the
maximum Y-axis value. In case the values are high (> 10^7), they are
cropped.

The fix is to adapt the left margin as a function of the size of the
maximum value.

opw-676538

* [FIX] account: partial reconcile unreconcile with deleted credit/debit move

`debit_move_id` and `credit_move_id` of
`account.partial.reconcile` must be required.

Not having one of them set on this model
does not make sense, you cannot have a reconciliation
with a debit move but without a credit move, for instance.

Databases already having the trouble,
having partial reconciliations without
either a debit or a credit move,
had issues for the computation of the
`payment_move_line_ids` compute field,
which relied on the fact these fields
were supposed to be required. This revision
makes a retro-compatibility patch for these
databases already having the issue.

opw-677709

* [FIX] account: invoice has not the same currency as the purchase order

Used case:

-Configure company in EUR, and user in multi-currency
-Create a purchase order in USD and confirm it
-Click on the smart button "0 invoices" then click on "create"

Result before the fix:

The system created an invoice in EUR, currency of the company,
instead of in USD, currency of the purchase order.

Result after the fix:

The system created an invoice in USD, the currency of the related purchase order.

opw:677568

* [FIX] calendar: don't block UI on slow /calendar/notify

Safe imp for a stable version. Better fix could be to send notifications
through the bus, but this would be in master.

* [FIX] web_calendar: search date range when no date_stop field

* [FIX] doc: white h2 title

Cherry-pick from odoo/documentation-user@d193f7c0

* [FIX] website_sale_delivery: reset carrier on cart update

It makes no sense to recompute delivery costs at each update of the cart;
furthermore, it prevents users that already selected a carrier to remove
the last products of their carts

This fix is additional to e4e1e571c2e5854b16b913b9b7bce9774b395055

* [FIX] mail: receiving a notification without notifying the parent message.

Used case:

If you add a user which has no acces on a model(ex:purchase.order)
as follower on a record of this model. When someone responded by email on
this record, and when a message is sent on this record, an exception is raised
at the connection of the user added as a follower.

Fix:

To have the rights to read the message, a read notification for this follower must
be added to all parents of this message.

Closes #11902

opw:676699

* [FIX] web_editor: serialise translations of html_translate fields

The html_translate fields (e.g. website_descripton on product.product) were not
serialised and the raw value from the web_editor was saved as a translation.

This was an issue in case of special characters that may be present in the
translation. A translation containing non-breaking space was sent in html
(`foo&nbsp;bar`) while lxml converts such characters to unicode (`foo\xa0bar`).

When writing a translation, the value is checked against incorrect format using
```
value0 = field.translate(lambda term: None, record[fname])
value1 = field.translate({trans.src: trans.value}.get, value0)
value2 = field.translate({trans.value: trans.src}.get, value1)
if value2 != value0:
    raise ValidationError(_("Translation is not valid:\n%s") % trans.value)
```

As value1 is the unicode version of the translation and `trans.value` is the
html version of the translation, the last substitution in the callback method
was never made and the ValidationError was raised.

This commit forces the serialisation through lxml to be sure the compared
strings are using the same parser instead of comparing value from summernote and
lxml that may be both valid but still different.

opw-675767

* [FIX] website_gengo: fixed button click and translations

- Fixed linking issue after click on 'Translate' button.
- Controller added to post terms in gengo

opw-648546

* [FIX] project_issue: number of issues

When no stage has been defined for a project, the new issues are
set in an undefined stage(stage_id = False). Then these issues must
be counted.

opw:676985

* [FIX] l10n_be: allow more than 120 periods

The widget selection only shows the first 120 results.
The selection was most likely set to avoid creating new entries but it can be
done with an option tag. This allows to use the search on many2one fields.

opw-677908

* [FIX] account: sequence of statement

The sequence used in the bank statement lines is not reliable. Indeed,
several lines might have the same sequence.

opw-676924

* [FIX] account: statement line amount rounding

See comment in code.

opw-676924

* [FIX] mail: to prevent infinite loop

Introduced by fac04424caa095511b0f809b351fc2af0a5942cc

* [FIX] account: duplicate journal should not use the same bank account

There is several override of create and write that assumes that a bank account
is present on only one account (see 4530e5d).
It is very hard to change or remove the account bank once linked to a journal
(see 4a65bc38) so it should not be set in the first place when duplicating a
journal.

opw-676374

* [FIX] hr_holidays: missing context

Closes #9386, opw-677958

* [FIX] web: company logo file extension

The company logo file extension is always '.png', even if the logo is of
another type such as 'jpg' or 'gif'. This is not an issue for decent
browsers, but IE might not display the image under specific
circumstancies, e.g. in combination with nginx.

opw-676836

* [IMP] doc : expand the coding guidelines

- correct typos
- clarify some points, according to the community comments
- precise the xml notation : record tag vs act_window/menuitem/... tags
- add organization of report, wizard, data/demo, ... (directories and naming conventions)
- new conventions for 'symbols'
- ...

Thanks to @rim-odoo for its grammar extremist review, and @tde-banana-odoo for our long debates about wizard conventions.

* [IMP] doc : add python idioms and odoo specific coding guidelines

- add python idioms
- odoo specific guidelines (for ORM, translations, ...) inspired from old guidelines v6.0
- some other best pratices

* [FIX] web: download file and editor firefox bug

When we download a file (as can be done with attachments in Odoo),
firefox is opening the link in current window but cancel the action once
it is aware the resource is to be downloaded.

But this get firefox into a corrupt state for some contenteditable
features, for example document.queryCommandState which is needed for the
editor will after downloading a file throw an error consistently instead
of working as expected.

It can be reproduced on firefox (at least from version 32 to 46) with
the following snippet:
 https://jsfiddle.net/s246u3ay/3/

The issue is probably linked to the following reported issue since 2005:
 https://bugzilla.mozilla.org/show_bug.cgi?id=297494

This commit avoid the bug by opening attachments download links in a new
window instead of the current one.

closes #12109
opw-676918

* [CLA] signature for Baldi Leandro (lbaldi)

Closes #12110

* [FIX] l10n_be_intrastat: traceback change new api

642fea4 updated some models to new API but this was not taken into
account into the part of the code this commit fix.

opw-677497

* [FIX] calendar: fetching images of negative ids

The mimetime fetching in /web/image/... may fail if:
- calendar is installed
- `id` is a string (using ?id=42 in the URI)
- `id` is a negative number (company partners on odoo.com)

The `search` override of `ir.attachment` in calendar detects if a number is a
virtual ID when it contains a '-' and is a string.

While it is not optimal to allow both int and str format for paramter `id`, make
the verification of virtual ID in calendar more strict to only match the format
`<real>-<virtual>` and not `-<real>`

* [IMP] calendar: avoid parsing for models that do not have virtual ids

And avoid bug with negative ids to happens in the first place

* [FIX] hr: trigger job count computation on employee archive

opw-676542

* [I18N] Update translation terms from Transifex

* [I18N] Update translation terms from Transifex

* Revert "[FIX] res.currency: allow duplication"

This reverts commit d780f9476d43eb4fd25c852dd4e691002f4a6dcf.

Did not work due to the size=3 on name field that strips the code to the first
three letters only (removing the " (copy)" part).
Copying a currency has a few business cases as the rates are not copied.
As can not increase the size of a field in stable, remove the method that had no
effect.

Fixes #11036

* [FIX] account_asset: depreciation start date

If 'Prorata Temporis' is not set, depreciation_date should be the 1st of
January of purchase year.

opw-677534

* [FIX] account: sort taxes

In the case of grouped taxes, the taxes would not be applied anymore
after commit 0a5b943d19129545724488f6026632bacd66a97b

opw-678158
opw-678219

* [FIX] doc: corrects spelling errors for cmdline

From #12028

* [FIX] account: invoice import with only partner and lines

When creating a new invoice through the web interface,
a bunch of "default" values are loaded once the partner
chosen, thanks to an onchange on this field,
such as the `account_id`, the fiscal position, etc.

It was not when importing an invoice, making it
more difficult to import an invoice.

In addition, the taxes lines were not computed at all
when importing an invoice with taxes within its
invoice lines, while it should be the case
if the tax lines are not forced during the import.

opw-678155

* [FIX] account: unlink account journal

The bank account linked to a journal cannot be systematicaly deleted
with its journal because this bank account can be linked to several
journals.

opw:676374

* [FIX] account: partner_id set on a bank fee

Used case:

-Create several customer invoices and validate them
-Register a payment without any partner_id and in a bank statement for an amount
a bit lower than the total of the invoice (the difference is the paypal fees)
-Reconcile the invoices with the payment and create a write-off for the paypal fees
-When you close the bank statement, check the journal items, the paypal fees are
automatically assigned with a partner.

Fix:

-When creating the account move line for the fee, if all the account move lines
linked to the move are for different partners then you cannot determine the partner
of the fee.

opw:674822

* [FIX] project_issue: number of issues for a customer

When counting the number of issues for a customer, all the the contacts
of this customer must be taken into account.

opw:676985

* [FIX] account: fix error in aged partner balance, variable at_least_one_amount referenced before assignment

* [IMP] im_livechat: don't auto-open on mobile

Currently on mobile, the livechat window would take all the viewport of
a small screen mobile browser. This combined with the "auto open"
feature can be desorienting: users could have only seen the "hello, how
may I help you ?" window and not know what to do or what is happening.

So this commit remove the "auto open" feature if user is on a too small
device (the user would thus have to click on "Have a Question").

closes #12148
opw-678012

* [FIX] website_mail: publications of internal notes

On the font-end view of project.issue, only the messages of type `note` were
display. This excluded the messages recieved via email which makes hard to
understand a conversation (e.g. a customer does not sees his own answers).

Instead, only filter out the notifications (change of states, responsible...)

opw-677426

* [FIX] account_asset: fiscal year date

The fiscal year start date should be taken into account when calculating
the depreciation amount in case of prorata temporis.

opw-678072

* [FIX] hr_payroll: avoid infinite recursion

The get_recursive_parent function seemingly depended on the ordering of
the rule_categories recordset which happens to work fine in most cases
because all data first defines the parent before defining the children
rule categories. But if you happen to do it the other way around it
won't work and it will infinitely call itself because:

if rule_categories[0].parent_id:
    rule_categories = rule_categories[0].parent_id | rule_categories

won't change the value of rule_categories[0].

opw-673222 (loosely related)

* [FIX] calendar: editing an existing recurrent event

It is not possible to edit the start_date, end_date, start_datetime,
end_datetime and duration for a recurrent event due to the raesons
explained in https://github.com/odoo/odoo/issues/10278 or see
opw:665700

opw:677139

* [FIX] stock_account: average cost with foreign currency

Quants are created, and stock moves are updated, with the purchase
value converted at current rates.  However, the product average
was calculated before that value was retrieved.  This ensures
the correct value is retrieved for the average cost calculation
and will match the actual quants.

Fixes #12163
Closes #12164
opw-678511

* [FIX] account: don't write the foreign currency on writeoff when several secondary currencies are involved

* [FIX] web_settings_dashboard: access error

When a user has the access rights "Configuration" or "Access Rights"
regarding the "Administration" module category, the click on the
"Settings" menu leads to an access error.

This is because the dashboard fetches data about the number of installed
modules ("installed_apps"), which requires access to "ir.module.module".
Since it is not easily possible to hide a parts of the dashboard (the
static templates do not recognize the "groups" attribute), we simply
hide the dashboard for these users.

opw-678531

* [IMP] website_project_issue: my/issues/id form improvements

1/ Display a button for the project_user to come back in backend and
   edit the issue if they want

* [IMP] website_mail: Display the message.atttachment_ids on message_thread

* [FIX] product_visible_discount: product without company_id

When computing the real price of a product, a currency of reference is
needed, first the currency of the product's company is privileged and
if no company is set on the product then the currency of the user's company
is taken.

opw:678159

* [FIX] web: chardomain, don't allow to edit the input when not in edit mode.

* [FIX] website_forum: typo in translation

* [IMP] gamification: prevent misconfiguration

Prevent selecting wrong field or models or computed fields

Fixes #8545

* [FIX] account: get_formview_id

For a type 'in_refund', the supplier account invoice form must be
taken.

opw:678498

* [FIX] point_of_sale: set callbacks for weight and price barcodes

c8732bea1e8471b90ac0c118b212a2d6ae84180a did not take into account that
we don't have specific callbacks for weight or price type
barcodes. Those where handled by the product callback.

opw-678556

* [FIX] web: raise a warning for bad domain

When a user wrote a wrong value in char_domain field it should raise a warning
message instead of a traceback.

Backport of b3a88b6ed846a13c0cd07cc25ea49bccbdf84aa8

opw:676783

* [FIX] calandar: all day events email notification

When sending a notification email to an event attendee
for an all day event, the timezone must be ignored
as the `start` and `stop` datetime are stored as
the day date + '00:00:00'. If the timezone is applied,
for users being in a negative timezone (such as an American
timezone), the day displayed would be the day just before.

opw-677019

* [FIX] crm: merge leads in multi-company

When merging leads with a company set different
than the current user company,
it failed because the notification email (the message
written in the thread summarizing the merge) couldn't
read the company name (the `name_get` call on the company)
because of the multi-company record rule.

`name_get` can be safely called as `sudo`, as it does
nothing else than returning the name of the record. This is
already done for the many2one links in the web client anyway
(You can see leads from a company different than yours,
you can see the company name to which the leads belongs to,
but you can't click on the company many2one link)

opw-677986

* [FIX] web: fix backport #4c7a9bd

* [FIX] translate: don't translate DOCTYPE tag

* [FIX] im_livechat: don't translate livechat javascript template

* [FIX] report: some Wkhtmltopdf installation can return an empty version

* [FIX] gamification: bad backport to 8.0

UserError was defined in version 9, not 8

* [INP] gamification: skip check for not required fields

Could get a definition with a model only

* [CLA] Rock Solid Solutions signs corporate CLA.

Closes #12182

* [FIX] sale: propagate context

Closes #9521

* [FIX] doc: update css file to reflect 8ce16c3

* [FIX] server: Do not listen when --no-xmlrpc is set

This is a fix for f04f409943b8bd8f4bd2653e368523d1cc0d8246, which only
prevented the workers from being spawned in Prefork mode, while the
socket was still being bound to - this is a problem when starting a
worker-only server as it cannot coexist with the XMLRPC server on the
same machine.

Closes #1828

* [FIX] sale: multi-company tax filtering

When the admin creates a SO, he has access to all taxes (since ir.rules
do not apply to him); therefore in some cases, the SO could be created
with SO lines that have taxes from other companies. This usually does
not make sense.

From this revision on, only taxes that are in the same company as the
SO are applied to the lines. If no company is set, then no filtering
is done.

* [FIX] crm_partner_assign: minimum access rights to employee

Give the same as access rights to the employee as for the public user.
This patch is needed to allow a user to access the partner form.
Same for portal.
The list of grades in not a confidential information.

Fixes #7719

* [FIX] *: replace uses of `except_osv` with `UserError` that have been forgotten during previous forward-ports

* [I18N] im_livechat: export source terms

* Revert "[FIX] translate: don't translate DOCTYPE tag"

This reverts commit 44e8b92beb4d066c6192fd723cff8299f19d9…

oeiter added a commit to oeiter/odoo that referenced this pull request Jun 8, 2016

merge code (#3)
* [FIX] base: no-break space in qweb

A non-breaking space is used between the amount and the currency.
However, if a space is used as a separator, there is a possibility that
the amount will be split into several lines.

opw-674535

* [FIX] google_calendar: do not copy user Google info

If a user syncs his calendar with Google,
and a second user is created in the database by copying this first
user, the Google information of the first user was copied
(The Google account to sync, the token to use, the last
syncrhonization date, ...), which is obviously wrong.

On calendar syncrhonization, which can be done
manually or automatically with the according cron, all
events of the first user were created a second time,
as a second user synchronized the same Google Calendar.

opw-674141

* [FIX] http: clear environment/caches on transaction rollback

Backport of 8423a0df3482567b0e2f77852dda14b80a029401

Clear the cache/environment in addition to rolling back
the cursor, in order to retry the transaction with fresh
data, not partially stale data.

* [FIX] account: periods in general ledger report

When "Filter by Periods" is choosen in the wizard, the right periods
must be set in ctx to filter the account moves according to the right periods

opw:674593

* [FIX] account: print multiple GL

When several accounts are selected to print their GL, the GL of only one
is printed. This is due to two issues:
- 'active_id' is retrieved instead of 'active_ids'
- the method `get_action` is called with the wrong records. `self`
  refers to the wizard, not to the accounts selected.

opw-676061

* [FIX] account: endless loop in exchange rate entry creation on full reconciliation fixed. ticket 676467

* [IMP] point_of_sale: verbose logging when dealing with 'rescue' sessions

When dealing with issues related to 'rescue' sessions we are very
limited in what we can do because the actual orders sent to the backend
exist only in localStorage in the browser on the device of the
user. Because of this it is important that we log some data about the
orders we receive in the backend to have an idea of what's going on.

opw-676497

* [FIX] purchase: taxes from PO

If a user removes the taxes on a PO line, the product taxes will be
added back when the invoice is created.

opw-676858

* [FIX] account_asset: Depreciation Expense Account and Depreciation Asset Account

"Depreciation Account" must be renamed in "Depreciation Expense Account"
Reason: This is the account that will be shown in the Profit and Loss, the original
label "Depreciation Account" is confusing because it could mean a depreciation asset
account.

"Asset Account" must be renamed in "Depreciation Asset Account"
Reason: This makes it clear that this is an asset account that will receive
depreciation entries, without this wording it could mean that we are simply
informing the Asset module which account is the asset account, but that depreciation
entries go elsewhere.

opw:672852

* [FIX] mail: missing translation due to typo

Closes #11929
opw-676854

* [ADD] tools: Swiss German language

Closes #4722

* [ADD] tools: Burmese language

* [FIX] account: sort taxes before computation

Taxes should be sorted before computation, otherwise if some taxes
affect subsequent taxes, the computation will be wrong.

opw-676119

* [FIX] account: base field in account.invoice.tax

The field base is obligatory according to a european law.
This field existed in saas-6.

opw:674713

* [FIX] point_of_sale: use client validation date instead of creation date

9f541d29bf58c3604f6c834ba25e1625c9ad1480 made it so that date_order on
pos.order records is set using the creation_date of the clientside Order
record to avoid weird date_order values when syncing to the server is
not done immediately.

The downside of this approach is that creation_date is set during Order
creation on the client. A user that has an open POS will also have an
open order. So if it takes one hour before the first order can be made
then the date_order will reflect this.

To avoid this we will instead use a validation date, which will be set
when the user clicks on the green 'Validate' button.

Because this is a stable release we won't change the name of the key in
the JSON data that gets sent to the server. This means that from the
server point of view nothing changes.

Fixes #11933

* [FIX] sale: exact matching on origin

Avoid that an invoice for 'SO042' matches with the invoices of 'SO04'.
The use of the like is required as it may contains more than one reference to an
invoice.

opw-676921

* [FIX] account: print Trial Balance

This applies commits 313bc91cf509353e5bdf8bf684589475527df7be and
2ad4bd4846074c4e4334aff13e32cc3335657c73 to Trial Balance report.

opw-676061

* [FIX] stock: Reversing scrapped moves

When reversing stock moves by clicking on "Reverse" in stock.picking
form view, only the stock moves not scrapped must be reversed.

opw:672236

* [FIX] purchase: date planned

When a PO is copied, the date planned of the order lines should be
recomputed based on the order date.

opw-675480

* [FIX] purchase: date planned

When a PO is copied, the date planned of the order lines should be
recomputed based on the order date.

opw-675480

* [FIX] account: multi-currency reconciliation use case as defined in opw 640248. Since the reconciliation changed, the bugfix made for saas-6 isn't valid anymore and was actually, the root cause of the same bug appearing in v9.

* [FIX] product: respect sequence when loading pricelist rules

Fixes #11987
Close #11988
opw-676422

* [FIX] mail: remove unneeded call to `refresh()`

With new api, this call is not wanted anymore. The cache is cleared
automatically, no need to clear the whole cache; that's a little bit
overkill and reduce performances.

* [IMP] account: improve reconciliation speed

 - Only invalidate cache for fields and records we modify
 - Rewrite query to be more efficient
 - Avoid o2m commands to be more efficient; write directly on reverse m2o

* [IMP] models: mark records as recomputed as soon as they are

When recomputing stored function fields, the `write` may trigger a
cache invalidation which lead to a recompute of all the recordset
values, even the ones already saved in database.

* [FIX] payment_authorize: use state code instead of state name

The state given to authorize requests should be the state code and not
the state name.

source:
https://support.authorize.net/authkb/index?page=content&id=A1454&actp=RSS

opw-675634

* [FIX] purchase: fiscal position from onchange_partner_id

Used case:

-Configure admin as multi-company user
-Create 2 fiscal positions (one for company "Odoo BE" and one for company "Odoo US")
-Set admin on company "Odoo BE"
-On supplier (Asustek) configure fiscal position Odoo BE
-Set admin on company "Odoo US"
-On supplier (Asustek) configure fiscal position Odoo US
-Configure a product (Laptop E5023) with:
   *route "Buy"
   *supplier (Asustek) without company
   *reordering rules (min qty: 20, max qty: 40)
-Set admin on company "Odoo BE"
-Run scheduler via the cron

Behavior before the fix:

-Fiscal position on the created PO is the fiscal position for "Odoo BE" (and PO is for the company "Odoo US")

Behavior after the fix:

-Fiscal position on the create PO is the fiscal position for "Odoo US".

Closes #11537

opw:673288

* [IMP] account: invoice analysis pivot quantities

In the report "Invoice Analysis", the view under the report is grouping
lines by invoice and also by product on this invoice.

Thus, quantities in the pivot view are not the real quantity of invoice
lines, but of invoice lines with different products.

eg:

invoice a:
- line 1: product X
- line 2: product Y
- line 3: product X

in the report there would appear to only be 2 invoice line, whilst there
is in realy three (this information is accessible via "# of Lines").

closes #11954
opw-676651

* [FIX] website: URL of website_published is wrong when using next/previous

Steps to reproduce:

-go to runbot 8.0 and connect
-go into human ressources/job positions
-pass into list view and click on the first item
-click on the url to open this record into the website (website_published)
-go back (back into the browser)
-you're now into the form view again and then next step is to click on the button
"next" to access the following record
-click on the url of website_published

Before the fix:

wrong record, this is the previous one that is into the href

After the fix:

correct record with the correct id into the href

Closes #11800
opw:675832

* [FIX] web_editor: scroll and editing menu modal

The class modal-open on body tag allow to scroll on the modal content
which is useful if the content is taller than the window viewport.

When closing the modal, this class is removed but there may be another
modal open on which we will not be able to scroll to view
buttons/content if too big.

This commit check if a modal is still opened after closing an editor
modal and in the affirmative add back the modal-open class.

opw-674475

note : was already present in 8.0 with ec47493, it is also present for
web.Dialog (but the modal of the editor do not inherit from web.Dialog)

* [FIX] account_asset: correct dependencies of `amount_residual` field

Also use a `set()` to avoid processing assets multiple times when
creating moves from lines

* [FIX] l10n_fr: FIX default Sale/Purchase tax. Courtesy of alexis-via. PR #11139

* [FIX] web_editor: video - allow to add video from unknown source

There are not cat... but you cannot know all the existing website in the world...
So, have faith in the user !

To do: allow to customize size or get it from iframe provided

* [FIX] tools: correct Burmese locale

* Revert "[FIX] product: respect sequence when loading pricelist rules"

This reverts commit b0f02e31b2e46685927ba6bb099158b6a211b6ce.

As pointed out by @nim-odoo [1], a similar patch has already been
uncommited few month ago [2].

Ref #11988
opw-676422

[1] https://git.io/vrYxY
[2] see a6badd25597e5e0930cb014fe94db754dae32c8f

* [IMP] document: indexation of MS documents

Commit 3ced0ff61 removed the support of Microsoft documents for
indexation. It makes sense for the old formats such as '.doc' since it
requires an external tool ('antiword'), which could lead to a security
issue. However, the new formats such '.docx' are simple xml files,
therefore they could be indexed with the usual XML parsing tools.

opw-677235

* [FIX] setup: missing dep for RHEL-based distros

* [FIX] web_kanban: quick redrag of kanban records

When dropping a record, it is updated and rerendered. The problem with
this behaviour is that if the record is redrag immediately after drop,
jquery-ui throws an error as the widget the user is trying to re-move
is being rerendered.

The solution provided by this commit is to block the draggable feature
while the record is being rerendered.

* [FIX] setup: use hard tabs

GTFO

* [IMP] website: share widget and multi language

The lang of the content of the "Share" widget was the one used when
inserting  it in the view. Thus if someone see a page with it in another
language the title and url for sharing is not translated.

This commit use the current page language to set the widget data.

opw-676062

* [FIX] setup: atom doesn't want to use hard tabs even when told to

This is now the 2d stupidest commit I ever did

* [FIX] core: correct `fields.modified_draft` for triggers on other models

* [FIX] l10n_be_intrastat: get location_id from stock move

purchase.order have been rewritten with cb01be2

It was not taken into account for intrastat  who still used the now not
existing "location_id" on purchase order.

This commit use instead the method _get_destination_location which
should be equivalent.

opw-677497

* [FIX] l10n_be_intrastat: typo

* [I18N] Update translation terms from Transifex

* [I18N] Update translation terms from Transifex

* [IMP] doc: Enterprise-compatible installation instructions

Before this revision, the installation instructions where
Community-centric, which led some customers to believe
that they had to install first Community then Enterprise.

This commit makes the instruction compatible for both editions.

* [FIX] web: fix duplicate changes in form view

Before this commit, in some cases, clicking on 'save' button, then on
other buttons (like 'validate' in invoices) had the unfortunate effect
of applying twice the changes in some cases.

More specifically the problem appears when:
1. an onchange is triggered (for example, taxes in invoices)
2. the user clicks on 'save', buttons are disabled
3. the 'save' actions is completed, the buttons are enabled, but
   the on_button_save still does some work: triggering event, and
   reloading the view
4. the user clicks on 'validate'
5. the onchange completes, this triggers some more work

Our only protection against such interactions is right now the fact that
buttons are disabled/enabled.  In my opinion, there should be a way
to guarantee that actions are properly serialized (that is actually what
a mutex is for... just saying). But the code of the form view/list view is
too coupled, and such changes are quite dangerous.  A real refactoring
of those is needed at some point in the future.

* [FIX] web: remove useless line

the enable_button call should have been removed...

* [FIX] base: Add missing return values

The _auto_init method was overriden without keeping the return value of
the super on some models.
This break the new stored computed fields computation at field creation.

Closes #11985
opw-677232

* [CLA] signature for s.sokolko

* [FIX] web: update compatibility layer

this commit adds better support in the compatibility layer of the
js framework.  This is necessary if one wants to follow the
official tutorial.

* [FIX] point_of_sale: select correct journal

An issue occurs in the following situation. Several cash journal are
configured for a given PoS, and a user performs a refund (the
transaction contains only a refund). In this case, the wrong journal
might be selected. This is because a payment line of zero is not sent to
the backend, and therefore an arbitrary journal is selected.

opw-676229

* [FIX] l10n_fr_fec: intial balance of accounts from the P&L should be summarized into a single line

* [IMP] doc: uniform design with user documentation

Apply the same changes from functionnal documentation to dev doc:
odoo/documentation-user@4316470

* [IMP] web/database manager: admin login & country

Add inputs e-mail address and country
when creating a newdatabase

This will provide the installation of the correct
chart of accounts at the installation of Accounting

Use the provided login as the admin login,
and set the email on the partner
if the login set is an email

Set the country on the company (and its partner)
The countries are parsed from XML country list

We take the opportunity to repair the `label for`
which bind the label with the input only if
the `id` attribute of the input is set with
what is set in the `for` attribute of the label

* [FIX] website: backport of 613ee31f9c67179c4e13aa9a2dbcef6492da38d9

* [FIX] account: readonly bank statement line

Like in "view_bank_statement_form" when a line is linked to
a journal entry, this line must be in readonly.

opw:676344

* [FIX] account: usererror takes only one argument

opw-677589

* [FIX] web: Y-axis formatting

In case of a line graph, the values of the Y axis are not formatted as
numbers, although they are on the bar graph.

* [FIX] web: left margin of graph

The left margin of the graph doesn't take into account the width of the
maximum Y-axis value. In case the values are high (> 10^7), they are
cropped.

The fix is to adapt the left margin as a function of the size of the
maximum value.

opw-676538

* [FIX] account: partial reconcile unreconcile with deleted credit/debit move

`debit_move_id` and `credit_move_id` of
`account.partial.reconcile` must be required.

Not having one of them set on this model
does not make sense, you cannot have a reconciliation
with a debit move but without a credit move, for instance.

Databases already having the trouble,
having partial reconciliations without
either a debit or a credit move,
had issues for the computation of the
`payment_move_line_ids` compute field,
which relied on the fact these fields
were supposed to be required. This revision
makes a retro-compatibility patch for these
databases already having the issue.

opw-677709

* [FIX] account: invoice has not the same currency as the purchase order

Used case:

-Configure company in EUR, and user in multi-currency
-Create a purchase order in USD and confirm it
-Click on the smart button "0 invoices" then click on "create"

Result before the fix:

The system created an invoice in EUR, currency of the company,
instead of in USD, currency of the purchase order.

Result after the fix:

The system created an invoice in USD, the currency of the related purchase order.

opw:677568

* [FIX] calendar: don't block UI on slow /calendar/notify

Safe imp for a stable version. Better fix could be to send notifications
through the bus, but this would be in master.

* [FIX] web_calendar: search date range when no date_stop field

* [FIX] doc: white h2 title

Cherry-pick from odoo/documentation-user@d193f7c0

* [FIX] website_sale_delivery: reset carrier on cart update

It makes no sense to recompute delivery costs at each update of the cart;
furthermore, it prevents users that already selected a carrier to remove
the last products of their carts

This fix is additional to e4e1e571c2e5854b16b913b9b7bce9774b395055

* [FIX] mail: receiving a notification without notifying the parent message.

Used case:

If you add a user which has no acces on a model(ex:purchase.order)
as follower on a record of this model. When someone responded by email on
this record, and when a message is sent on this record, an exception is raised
at the connection of the user added as a follower.

Fix:

To have the rights to read the message, a read notification for this follower must
be added to all parents of this message.

Closes #11902

opw:676699

* [FIX] web_editor: serialise translations of html_translate fields

The html_translate fields (e.g. website_descripton on product.product) were not
serialised and the raw value from the web_editor was saved as a translation.

This was an issue in case of special characters that may be present in the
translation. A translation containing non-breaking space was sent in html
(`foo&nbsp;bar`) while lxml converts such characters to unicode (`foo\xa0bar`).

When writing a translation, the value is checked against incorrect format using
```
value0 = field.translate(lambda term: None, record[fname])
value1 = field.translate({trans.src: trans.value}.get, value0)
value2 = field.translate({trans.value: trans.src}.get, value1)
if value2 != value0:
    raise ValidationError(_("Translation is not valid:\n%s") % trans.value)
```

As value1 is the unicode version of the translation and `trans.value` is the
html version of the translation, the last substitution in the callback method
was never made and the ValidationError was raised.

This commit forces the serialisation through lxml to be sure the compared
strings are using the same parser instead of comparing value from summernote and
lxml that may be both valid but still different.

opw-675767

* [FIX] website_gengo: fixed button click and translations

- Fixed linking issue after click on 'Translate' button.
- Controller added to post terms in gengo

opw-648546

* [IMP] web: multi-click on save on view form (no fp)

When clicking on save several time when editing a view form it can be
saved several times which can be an issue for one to many.

The normal happenstance when saving should be as follow:

-> save (click)
-> wait write result
-> received write result
-> reload the form with updated data and updates buttons

But when clicking several time, it could become:

-> save (click)
-> wait write result
-> received write result
-> save (click)
-> wait write result
-> received write result
-> reload the form with updated data and updates buttons

This commit only reinstate the saving feature once the form is reloaded.

related to opw-671793
backport of 8.0's dd714ac

note: no need to forward-port

* [FIX] project_issue: number of issues

When no stage has been defined for a project, the new issues are
set in an undefined stage(stage_id = False). Then these issues must
be counted.

opw:676985

* [FIX] l10n_be: allow more than 120 periods

The widget selection only shows the first 120 results.
The selection was most likely set to avoid creating new entries but it can be
done with an option tag. This allows to use the search on many2one fields.

opw-677908

* [FIX] account: sequence of statement

The sequence used in the bank statement lines is not reliable. Indeed,
several lines might have the same sequence.

opw-676924

* [FIX] account: statement line amount rounding

See comment in code.

opw-676924

* [FIX] mail: to prevent infinite loop

Introduced by fac04424caa095511b0f809b351fc2af0a5942cc

* [FIX] account: duplicate journal should not use the same bank account

There is several override of create and write that assumes that a bank account
is present on only one account (see 4530e5d).
It is very hard to change or remove the account bank once linked to a journal
(see 4a65bc38) so it should not be set in the first place when duplicating a
journal.

opw-676374

* [FIX] hr_holidays: missing context

Closes #9386, opw-677958

* [FIX] web: company logo file extension

The company logo file extension is always '.png', even if the logo is of
another type such as 'jpg' or 'gif'. This is not an issue for decent
browsers, but IE might not display the image under specific
circumstancies, e.g. in combination with nginx.

opw-676836

* [IMP] doc : expand the coding guidelines

- correct typos
- clarify some points, according to the community comments
- precise the xml notation : record tag vs act_window/menuitem/... tags
- add organization of report, wizard, data/demo, ... (directories and naming conventions)
- new conventions for 'symbols'
- ...

Thanks to @rim-odoo for its grammar extremist review, and @tde-banana-odoo for our long debates about wizard conventions.

* [IMP] doc : add python idioms and odoo specific coding guidelines

- add python idioms
- odoo specific guidelines (for ORM, translations, ...) inspired from old guidelines v6.0
- some other best pratices

* [FIX] web: download file and editor firefox bug

When we download a file (as can be done with attachments in Odoo),
firefox is opening the link in current window but cancel the action once
it is aware the resource is to be downloaded.

But this get firefox into a corrupt state for some contenteditable
features, for example document.queryCommandState which is needed for the
editor will after downloading a file throw an error consistently instead
of working as expected.

It can be reproduced on firefox (at least from version 32 to 46) with
the following snippet:
 https://jsfiddle.net/s246u3ay/3/

The issue is probably linked to the following reported issue since 2005:
 https://bugzilla.mozilla.org/show_bug.cgi?id=297494

This commit avoid the bug by opening attachments download links in a new
window instead of the current one.

closes #12109
opw-676918

* [CLA] signature for Baldi Leandro (lbaldi)

Closes #12110

* [FIX] l10n_be_intrastat: traceback change new api

642fea4 updated some models to new API but this was not taken into
account into the part of the code this commit fix.

opw-677497

* [FIX] calendar: fetching images of negative ids

The mimetime fetching in /web/image/... may fail if:
- calendar is installed
- `id` is a string (using ?id=42 in the URI)
- `id` is a negative number (company partners on odoo.com)

The `search` override of `ir.attachment` in calendar detects if a number is a
virtual ID when it contains a '-' and is a string.

While it is not optimal to allow both int and str format for paramter `id`, make
the verification of virtual ID in calendar more strict to only match the format
`<real>-<virtual>` and not `-<real>`

* [IMP] calendar: avoid parsing for models that do not have virtual ids

And avoid bug with negative ids to happens in the first place

* [FIX] hr: trigger job count computation on employee archive

opw-676542

* [I18N] Update translation terms from Transifex

* [I18N] Update translation terms from Transifex

* Revert "[FIX] res.currency: allow duplication"

This reverts commit d780f9476d43eb4fd25c852dd4e691002f4a6dcf.

Did not work due to the size=3 on name field that strips the code to the first
three letters only (removing the " (copy)" part).
Copying a currency has a few business cases as the rates are not copied.
As can not increase the size of a field in stable, remove the method that had no
effect.

Fixes #11036

* [FIX] account_asset: depreciation start date

If 'Prorata Temporis' is not set, depreciation_date should be the 1st of
January of purchase year.

opw-677534

* [FIX] account: sort taxes

In the case of grouped taxes, the taxes would not be applied anymore
after commit 0a5b943d19129545724488f6026632bacd66a97b

opw-678158
opw-678219

* [FIX] doc: corrects spelling errors for cmdline

From #12028

* [FIX] account: invoice import with only partner and lines

When creating a new invoice through the web interface,
a bunch of "default" values are loaded once the partner
chosen, thanks to an onchange on this field,
such as the `account_id`, the fiscal position, etc.

It was not when importing an invoice, making it
more difficult to import an invoice.

In addition, the taxes lines were not computed at all
when importing an invoice with taxes within its
invoice lines, while it should be the case
if the tax lines are not forced during the import.

opw-678155

* [FIX] account: unlink account journal

The bank account linked to a journal cannot be systematicaly deleted
with its journal because this bank account can be linked to several
journals.

opw:676374

* [FIX] account: partner_id set on a bank fee

Used case:

-Create several customer invoices and validate them
-Register a payment without any partner_id and in a bank statement for an amount
a bit lower than the total of the invoice (the difference is the paypal fees)
-Reconcile the invoices with the payment and create a write-off for the paypal fees
-When you close the bank statement, check the journal items, the paypal fees are
automatically assigned with a partner.

Fix:

-When creating the account move line for the fee, if all the account move lines
linked to the move are for different partners then you cannot determine the partner
of the fee.

opw:674822

* [FIX] project_issue: number of issues for a customer

When counting the number of issues for a customer, all the the contacts
of this customer must be taken into account.

opw:676985

* [FIX] account: fix error in aged partner balance, variable at_least_one_amount referenced before assignment

* [IMP] im_livechat: don't auto-open on mobile

Currently on mobile, the livechat window would take all the viewport of
a small screen mobile browser. This combined with the "auto open"
feature can be desorienting: users could have only seen the "hello, how
may I help you ?" window and not know what to do or what is happening.

So this commit remove the "auto open" feature if user is on a too small
device (the user would thus have to click on "Have a Question").

closes #12148
opw-678012

* [FIX] website_mail: publications of internal notes

On the font-end view of project.issue, only the messages of type `note` were
display. This excluded the messages recieved via email which makes hard to
understand a conversation (e.g. a customer does not sees his own answers).

Instead, only filter out the notifications (change of states, responsible...)

opw-677426

* [FIX] account_asset: fiscal year date

The fiscal year start date should be taken into account when calculating
the depreciation amount in case of prorata temporis.

opw-678072

* [FIX] hr_payroll: avoid infinite recursion

The get_recursive_parent function seemingly depended on the ordering of
the rule_categories recordset which happens to work fine in most cases
because all data first defines the parent before defining the children
rule categories. But if you happen to do it the other way around it
won't work and it will infinitely call itself because:

if rule_categories[0].parent_id:
    rule_categories = rule_categories[0].parent_id | rule_categories

won't change the value of rule_categories[0].

opw-673222 (loosely related)

* [FIX] calendar: editing an existing recurrent event

It is not possible to edit the start_date, end_date, start_datetime,
end_datetime and duration for a recurrent event due to the raesons
explained in https://github.com/odoo/odoo/issues/10278 or see
opw:665700

opw:677139

* [FIX] stock_account: average cost with foreign currency

Quants are created, and stock moves are updated, with the purchase
value converted at current rates.  However, the product average
was calculated before that value was retrieved.  This ensures
the correct value is retrieved for the average cost calculation
and will match the actual quants.

Fixes #12163
Closes #12164
opw-678511

* [FIX] account: don't write the foreign currency on writeoff when several secondary currencies are involved

* [FIX] web_settings_dashboard: access error

When a user has the access rights "Configuration" or "Access Rights"
regarding the "Administration" module category, the click on the
"Settings" menu leads to an access error.

This is because the dashboard fetches data about the number of installed
modules ("installed_apps"), which requires access to "ir.module.module".
Since it is not easily possible to hide a parts of the dashboard (the
static templates do not recognize the "groups" attribute), we simply
hide the dashboard for these users.

opw-678531

* [IMP] website_project_issue: my/issues/id form improvements

1/ Display a button for the project_user to come back in backend and
   edit the issue if they want

* [IMP] website_mail: Display the message.atttachment_ids on message_thread

* [FIX] product_visible_discount: product without company_id

When computing the real price of a product, a currency of reference is
needed, first the currency of the product's company is privileged and
if no company is set on the product then the currency of the user's company
is taken.

opw:678159

* [FIX] web: chardomain, don't allow to edit the input when not in edit mode.

* [FIX] website_forum: typo in translation

* [IMP] gamification: prevent misconfiguration

Prevent selecting wrong field or models or computed fields

Fixes #8545

* [FIX] account: get_formview_id

For a type 'in_refund', the supplier account invoice form must be
taken.

opw:678498

* [FIX] point_of_sale: set callbacks for weight and price barcodes

c8732bea1e8471b90ac0c118b212a2d6ae84180a did not take into account that
we don't have specific callbacks for weight or price type
barcodes. Those where handled by the product callback.

opw-678556

* [FIX] web: raise a warning for bad domain

When a user wrote a wrong value in char_domain field it should raise a warning
message instead of a traceback.

Backport of b3a88b6ed846a13c0cd07cc25ea49bccbdf84aa8

opw:676783

* [FIX] calandar: all day events email notification

When sending a notification email to an event attendee
for an all day event, the timezone must be ignored
as the `start` and `stop` datetime are stored as
the day date + '00:00:00'. If the timezone is applied,
for users being in a negative timezone (such as an American
timezone), the day displayed would be the day just before.

opw-677019

* [FIX] crm: merge leads in multi-company

When merging leads with a company set different
than the current user company,
it failed because the notification email (the message
written in the thread summarizing the merge) couldn't
read the company name (the `name_get` call on the company)
because of the multi-company record rule.

`name_get` can be safely called as `sudo`, as it does
nothing else than returning the name of the record. This is
already done for the many2one links in the web client anyway
(You can see leads from a company different than yours,
you can see the company name to which the leads belongs to,
but you can't click on the company many2one link)

opw-677986

* [FIX] web: fix backport #4c7a9bd

* [FIX] translate: don't translate DOCTYPE tag

* [FIX] im_livechat: don't translate livechat javascript template

* [FIX] report: some Wkhtmltopdf installation can return an empty version

* [FIX] gamification: bad backport to 8.0

UserError was defined in version 9, not 8

* [INP] gamification: skip check for not required fields

Could get a definition with a model only

* [CLA] Rock Solid Solutions signs corporate CLA.

Closes #12182

* [FIX] sale: propagate context

Closes #9521

* [FIX] doc: update css file to reflect 8ce16c3

* [FIX] server: Do not listen when --no-xmlrpc is set

This is a fix for f04f409943b8bd8f4bd2653e368523d1cc0d8246, which only
prevented the workers from being spawned in Prefork mode, while the
socket was still being bound to - this is a problem when starting a
worker-only server as it cannot coexist with the XMLRPC server on the
same machine.

Closes #1828

* [FIX] sale: multi-company tax filtering

When the admin creates a SO, he has access to all taxes (since ir.rules
do not apply to him); therefore in some cases, the SO could be created
with SO lines that have taxes from other companies. This usually does
not make sense.

From this revision on, only taxes that are in the same company as the
SO are applied to the lines. If no company is set, then no filtering
is done.

* [FIX] crm_partner_assign: minimum access rights to employee

Give the same as access rights to the employee as for the public user.
This patch is needed to allow a user to access the partner form.
Same for portal.
The list of grades in not a confidential information.

Fixes #7719

* [FIX] *: replace uses of `except_osv` with `UserError` that have been forgotten during previous forward-ports

* [I18N] im_livechat: export source terms

* [FIX] web: graph numbers

Backport of commit 68b127797e717ee71b5b0552d69f0f4b4e083f03

opw-678645

* Revert "[FIX] translate: don't translate DOCTYPE tag"

This reverts commit 44e8b92beb4d066c6192fd723cff8299f19d9628.

The condition is wrong as a view starting with DOCTYPE as top element will be
excluded, including its child (the whole page them).

Re-add the translatable title that was excluded by the condition.

* [FIX] website: robust attribute checking

When installing website or one of its dependencies directly, the website
attribute is not defined on request. If the installation triggers qweb
rendering [1], we need to correctly check the presence of the website
attribute, which this commit does.

[1]: This is the case in website_blog since
4a132e2afbce4a688afbc72f294e14ad6c7ff8c1

* [FIX] point_of_sale: respect user timezone for all data in Sale Details

9f0120d73bbbc364d8ec04b0e3ad63c75086ba52 solved this issue already, but
it was only applied to POS orderlines. There is other data on the
report (eg. payments, taxes, ...) that should also correctly respect the
user time zone as well.

opw-678748

* [IMP] doc: wording

Closes #12159

* [FIX] website_forum: notification of comments like answers

Fixes #12096

* [FIX] website_sale: allow to override product order on shop

Close #11202

* [FIX] mail: don't reset subscriptions before adding one

When posting on a thread the user can be auto-subscribed to its default
types. But if the user has previously been subscribed to other subtypes,
those are lost.

With this commit, user mentionned (@{username} in message) or added as
follower for default subtypes are not subscribed if they were already
followers of the record.

So if default subtype is "Comment" and user was only following subtype
"Alarma!" (by checking it and then un-checking "Comment"), then if the
user comment:

-> before this commit, the user would then follow subtype "Comment" and
   not follow anymore "Alarma!"

-> after this commit, the user would follow the subtype "Alarma!"

closes #12008
opw-669127
opw-673766

* [FIX] web: minimum margin

Make sure to define a minimum margin large enough.

opw-678645

* [FIX] product: pricelist item sorting

The issue occurs in the following case:
- Configure 2 product categories A and B such as A is the parent of B
- Create a pricelist
- Create a first pricelist item which applies to category A
- Create a second pricelist item which applies to category B (with the
  same configuration regarding the minimum quantity)
- Create a product for category B

Before this fix, we cannot ensure that the pricelist item related to
category B will be applied, since we do not order the pricelist items by
category.

Thanks to this fix, we make sure to select the category from the more
specific to the less specific.

opw-678633

* [FIX] payment_ogone: missing key

The key 'PAYIDSUB' should be added in the list of SHA-OUT keys.,
otherwise the signature is wrong.

opw-678718

* [FIX] account_asset: use newest depreciation date for new depreciations

The code uses self.depreciation_line_ids[0] and incorrectly assumes it
is always the latest (newest) depreciation line. This sorts the
recordset to guarantee that this is true.

opw-678678

* [FIX] account: substitution in aged partner report

'foo %s bar' % 'alice' if False else 'bob' returns 'bob', not 'foo bob bar'

The previous strings returns '>=' when the direction is future while it should
be 'COALESCE(l.date_maturity,l.date) >= %s'

Fixes #10654
Closes #10695

* [FIX] account: manual reconciliation through the wizard on journal items were giving weird results. OPW 678153.

Symptoms: running a full reconciliation manually with that wizard was resulting in not fully reconciled aml altough the total in company currency and in secondary currency were perfectly matched. Full use case described in added test test_manual_reconcile_wizard_opw678153.
Problems:
 - The system was processing by pair of aml and creating exchange rate entry/full reconciliation as soon as possible whereas in that case it needs to be postponed at the end of the manual reconciliation otherwise some entries would be excluded from processing.
 - Another problem was that because of this batch processing, we ended with unconsistent amount_residual_currency values for some entries that were fully reconciled in company currency but not in foreign currency (also negative amount_residual_currency for a debit line which should never happens)... To solve that, we now process the manual full reconciliation in two steps: only in company currency first, then in secondary currency if needed. A small adaptation in the payment widget of invoices was needed for that too.

* [FIX] sale: avoid division by zero in _get_price_reduce

close #11999

* [FIX] pos_restaurant: remove floor_id from restaurant.table form view

There is no way to directly create restaurant.table records in the
backend. The only way is through adding it directly to the table_ids
one2many on restaurant.floor and when doing that floor_id is
automatically set.

Closes #8705

* [I18N] Update translation terms from Transifex

* [I18N] Update translation terms from Transifex

* [CLA] Update Therp BV's signature

To have consistent email in author and signer key.
Also update list of contributors as Stefan is no longer working for Therp BV.

Closes #12202

* [CLA] corporate signature for DevCo Colombia

Closes #11755

* [FIX] account,*: preserve deactivated taxes

By default, when reading a m2m field, entries that are
deactivated in the destination table are not included.
This behavior is desirable in some cases (e.g. for
"tags" or "categories", but not for entries that
significantly impact other field values in the parent
record, such as taxes.

The problem is rather obvious: when displaying a
paid invoice that used taxes that are now deactivated,
the taxes are hidden while they still affect the
computed amount. And after cancelling + resetting
to draft, the tax is not taken into account anymore,
while still being linked.

Forcing the field-level (python) domain to include
both active and inactive entries solves the problem:
 - when reading, displaying and recomputing values,
   deactivated taxes will be included.
 - when trying to pick a tax, deactivated entries
   will still be ignored, as expected.

This commit applies the technique to all m2m
fields that refer to taxes.

Fixes #12066
opw-677751

* [CLA] Corporate signature for Aetna Softwares

Closes #12214

* [FIX] purchase: wrong call to super

opw-675480

* Revert "[FIX] website_forum: notification of comments like answers"

This reverts commit e32ba845de73a251fba4f12af45c880898cb4344.

This commit is wrong as it had an undifined variable and was losing the content
of the comment anyway.

Fixes #12213

* [FIX] account: correct message for lock dates

The sentence concerning the adviser should not be raised if the user is an adviser role.

opw:678458

* [FIX] crm,gamification: flexible reference to field

The field generation is most of the time following the pattern
`field_<table name>_<field name>`
but in case of name clash (e.g. res.partner.category - id and res.partner -
category_id), the id of ir.model.field is added at the end of the external id
during the field creation.

The more flexible way to link to an ir.model.field is to use the syntax
`search=[('model', '=', <model>), ('name', '=', <field name>)]`
to avoid errors as in #12192 when the "first" external id no longer exists.

Fixes #12192
Closes #12198

* [FIX] sale: Warning when Create invoice from SO

Used case:
Create a SO with invoicing policy based on delivery. Don't deliver
anything and Create invoice for all invoiceable lines.
Result:
There was no invoice created and no warning message.
After the fix:
A warning message is raised when after clicking "Create
invoice",for any reason it doesn't create an invoice.

opw:678567

* [FIX] account_asset: don't recompute depreciation board on state change

When a user goes through the trouble of manually modifying the
depreciation lines he will lose all his work when clicking on 'reset to
draft'. Furthermore, if he then goes through the trouble of repairing
the problem by once again manually changing the depreciation lines he
will again lose his work when pressing confirm.

opw-678678

* [FIX] openerp: force Odoo to serve svg with mimetype image/svg+xml

Odoo serves files based on the mimetype imported with python module Mimetype.
In some case, mimetype on windows for svg is undefined or misconfigured and
the svg is returned as text/plain (and so xml and not img).

This commit overrides the default mimetype to render .svg file with mimetype
'image/svg+xml'.

It is similar to add/override the key from windows registry with:
```
[HKEY_CLASSES_ROOT\.svg]
@="svgfile"
"Content Type"="image/svg+xml"
```
The advantage to override it in Odoo, is to be sure that even if this key has
been updated or deleted by a cleaner software or malware, Odoo continue to work

This closes odoo/odoo#12150, closes odoo/odoo#9061, closes odoo/odoo#9118

* [FIX] account: fix potential traceback

`all([]) = True`, therefore if there is no `matched_debit_ids` or
`matched_credit_ids` on a payment ==> boom when you access
`payment.matched_debit_ids[0]`

opw-677157
Closes #12232
Closes #12242

* [FIX] account, account_asset, stock_account: get the right account for an asset

When creating an invoice line from a PO, if the product is linked to an Asset type
then the account used for this line must be the expense account.

When creating an invoice line from a SO, if the product is linked to an deferred revenue type
then the account used for this line must be the income account.

* [FIX] account_asset: posted entries from account asset

The entries created from an asset don't have to be posted if
the asset category has its field "open_asset" set to False.

opw:678771

* [FIX] purchase: Expected date not stored

It is not possible to group by "Expected Date" because the field is
not stored.

opw:678591

* [FIX] stock: hide partner_id for internal transfers

onchange_picking_type func now return picking_type_code
The stock.picking has an attrs to hide the partner_id for internal transfers.
It was not set as picking_type_code was not set.

Closes #12117

* [CLA] Corporate signature for GRAP

Closes #12117

* [FIX] hr: allow to add stages to a job position.

In v9, stages are not shared by default. So when you create a new job position,
you need to specify manually which stages are available for this job position.
But the field stage_ids was not available.

* [FIX] account: don't write ref/date again on move when creating tax line

* [FIX] hr_recruitment: fix stage_ids in form view

Revert and related to commit: odoo/odoo@d1073f8e483ea0afc029091e62e2b3aa6aac5145
Re close #12246

* [FIX] account.invoice: prevent deleting taxes that are in use

Related to #12066 (see comments)

* [FIX] crm: `date_closed` when writting without `probability` value

If `probability` is not being written,
`vals.get('probability')` is `None`
`None` < 100 is `True`

While it should not remove the `date_closed` value
when the probability field is not being rewritten
on the lead, but something else is.

opw-677273

* [I18N] Update translation terms from Transifex

* [ADD] l10n_nz: add New Zealand COA

Chart of accounts structure and localisation for New Zealand.

opw-678956
Closes #9234

* [IMP] l10n_au: Australian COA enhancements

Added new accounts, fiscal positions and taxes

opw-678956
Closes #12081

* [IMP] l10n_au: tax definition change

Change tax collection definion for private use (and others) to not
accumulate in GST accounts.

opw-678956
Closes #12081

* [FIX] point_of_sale: hide QWeb header/footer from non-ESC/POS receipt

We allow users to specify QWeb in the header and footer fields of the
receipt. Because the browser receipt and the ESC/POS receipt use a
different format (HTML and ESC/POS XML respectively) we don't render
this QWeb to both receipts. Currently it is only rendered for the
ESC/POS receipt. When this is the case however, we shouldn't display the
unrendered QWeb on the regular browser receipt. This commit simply hides
it.

Perhaps in the future we can provide an additional parameter in the
<DOCTYPE declaration that allows the user to specify whether he wants
the QWeb to apply to the HTML receipt and/or the ESC/POS receipt.

opw-678170

* [FIX] website_sale: add color value on attributes

xml template was using color name, because color index was empty.
It works in English, but once translated (in french e.g.) we have background-color:noir

Fix #12251

* [FIX] point_of_sale: apply extended cash box behavior properly

Normally when you manually add or remove money from the cashbox the
reference on the bank statement line should be set to the name of the
session. But because the wrong function names where used this didn't
happen. Introduced by f5ad25168674e33149f4371ac0115b1f5bd9e6f3.

Fixes #12224

* [FIX] account: avoid deleting taxes when they are linked to move lines

Equivalent of 8c337f97433e437aac050e0af614bfdd812bfbdd
but for account.move.line as well.

Closes #11883

* [FIX] ir.translation: avoid duplicating translations

Rev. 253437f81f70e8852907725a2b2fed13e4ec6d43 meant to
avoid the creation of duplicate entries during translation
import, caused by existing translations created with an
empty `module` field.

But the fix was over-zealous and caused an extra side-effect:
the creation of missing translations (the blue flag icon)
now creates duplicate translations if other translations
exist with different `module` values.
(This could happen because translations are provided by
several modules, or due to manual translation entries with
no module value, etc.)

* [FIX] account : _prepare_reconciliation_move_line

When computing the amount_currency, the ratio is 1.0 if the difference
between amount(computed like this -sum([x.balance for x in move.line_ids]))
and the amount set in the statement is not greater than the currency rounding.
opw:678588

* [FIX] stock: hide header on stock.picking form view on small displays

Related to c6fc91b3182d1651c0326ba2f491f659457b4497.

fp request

* [FIX] custom fields: make the flag 'translate' visible for html fields

opw:678921

* [FIX] mass_mailing: filter emails to avoid duplicates

When subscribing a user to a mailing list, the `mail.mass_mailing.contact`
created is processed to identify it's name and email from the address (method
`get_name_email` called in `add_to_list` and `name_create`).
For a better consistency, the search of existing contacts should also be done
using the method `get_name_email`.

This avoids that subscribing twice `Example <example@example.com>` fails to
detect duplicates and creates two subscriptions.

Closes #12265

* [FIX] subscription: avoid trying to access to subscriptions without cron

The cron may no longer be present (e.g. deleted) and the subscribtion would be
blocked in running state.

Fixes #12207

* [FIX] mrp: inventory value of produced items

Since the revision bc23c92c3ed07283bbd40f88ce73024572922a72,
the inventory value of the produced items could
be doubled, because the list
`total_consume_moves` could contain several time
the same move ids, e.g. when it was added by
`total_consume_moves.append(raw_material_line.id)`
and
`total_consume_moves += already_consumed_lines.ids`

The list is replaced by a set to ensure a same move
cannot be counted twice.

opw-678727

* [FIX] account: invoice analysis report fixed.
* price_average is now always positive regardless of the invoice type, because it's an average and there's no point in summing those values
* price_total is now computed by using ABS() because of a migration bug of price_subtotal_signed introduced in saas-6, where in_invoice and in_refund invoices were set with a negative value while on the help tooltip it was saying that in/out refunds are negative and in/out invoices are positive. That bug was only revealed in v9 -since saas-6 wasn't using that field at all-, with the effect of having wrong values in report for migrated databases. This workaround using ABS() will be removed in a further version with a migration script to fix people's databases.
* residual field is now negative for in_invoices and out_refunds.
* These 2 points ensure that we can group by invoice type and sum the price_total or the residual fields to get the gross income of a month for example.

* [FIX] product_extended: traceback on `bom_count`

The field `bom_count` is added in the view for group `group_mrp_user`.
Therefore when extending the view, we should make sure to restrict the
access as well.

opw-679172

* [FIX] website_sale: `State` select readonly in shipping info

If we take the below facts:
 - The country select is set as disabled
   when Shipping is set to "Ship to the same address"
 - The disable property of select inputs is
   removed when shipping is set to
   `create a new address`:
   In `website_sale.js`:
   ```
   $selects.attr("disabled", value <= 0 ? null : "disabled" ).prop("disabled", value <= 0 ? null : "disabled" );
   ```

We can safely assume that the select input "State / Province" was supposed
to be set as `disabled` in the first place, not as `readonly`

Before this revision, State / Provice was greyed when choosing
"Create a new address" for shipping, and selecting the United States
(but the select input was still usable, though, it was just greyed)

opw-675739

* [FIX] website_forum: convert content of posted comment to plaintext

HTML content should be escaped before being sanitized. Any content (link, image,
code,...) that is acceptable in usual mail.message but should not be interprated
when posted on a comment of the forum.

Fixes #3737

* [FIX] l10n_lu: Change the sign for VP-IC-EX. Was PR #12041

* [CLA] signature for lbelorgey

Closes #11226

* [FIX] doc: declaration of computed fields

Cannot link a method before declaring it.

Closes #12057

* [FIX] base_import: t-if does not work with t-jquery

Not evaluated, move the condition to the button
Closes #12230

* [FIX] res.partner: performance of name_get()

Rev. 93e9a4dce7550af5cecab398670a4a53ea41f130 tried to speed up
the 9.0 name_get() of res.partner by only calling fields_get()
once for the whole name_get, instead of calling it lazily.

This may have worked for name_get calls on multiple unnamed
addresses (name is NULL), but this is a rare occurrence
in practice - while now every single name_get() call would
incur the full cost of the fields_get() call.

That fields_get() call is O(n) in the number of fields,
and there can be quite a few for res.partner.
Calling it only for the specific 'type' field can easily be
about 40x faster than without it.

And since name_get() is called for each Many2One field
of each record being read (due to convert_to_read()), reading
a batch of records with partner fields had become quite
a bit slower!

Avoiding this cost entirely with lazy fields_get() calls
saves quite a lot of time for the common cases. And now
that fields_get() specifies a single field, it is cheap
enough to be called within the loop.

Non-scientific benchmark: account.invoice.search_read() in
the list view of invoices took 500ms for 25 invoices
_before_ this fix, and 90ms after!

* [IMP] account: The new draft invoice has the sale order as the source document.

Context:
Source document on invoice created through a credit note with the modify option

Current issue:
create an invoice from a sale order,
validate it,
Create a refund with the modify option
The first invoice is reconciled with the refund
The new draft invoice doesn't have a source document and can't be reached from the SO

Expect result:
The new draft invoice should have the sale order as the source document

* [IMP] sales_team: don't auto install sales_cteam

Module sales_team was auto installed if base and mail was installed, but
this isn't wanted as it is already a depends of crm and sale modules
which should be anyway installed for sales team to have a meaning.

This could lead to a glitch with the sale apps displayed whilst it
should not be.

opw-679223

* [FIX] purchase: properly forward defaults in copy override

fixes #12280

* [FIX] res_currency: company rates subselect

The sub-select used to fetch companies rates
was wrong in the case rates with no company set
were entered before rates for specific companies.

e.g., for USD, the below rates:
Date        Rate        Company
2016-02-13  0.721400
2016-02-25  0.738800    1
2016-02-26  0.740000    1

the sub-select returned
Rate        Start       End
0.721400    2016-02-13
0.738800    2016-02-25  2016-02-26
0.740000    2016-02-26

while it was expected to return
Rate        Start        End
0.721400    2016-02-13  2016-02-25
0.738800    2016-02-25  2016-02-26
0.740000    2016-02-26

as the rate 0.721400 ended on 2016-02-25,
since a new rate specific to this company 1 was
added at that date.

opw-678726

* [FIX] account: Filter on contact by total receivable/payable fixed. opw 669833

* [I18N] Update translation terms from Transifex

* [I18N] Update translation terms from Transifex

* [FIX] account_asset: compute_depreciation_board

The last depreciation date must be take from the last posted depreciation
line.

opw:679212

* [FIX] translate: do not translate <!DOCTYPE>

Avoid the DOCTYPE tranlation. If this tag is changed, the html rendering is altered. The other effet is that the web_editor wrap the content with <span> to translate, but some explorer eject tags (doctype, head content, script, style, meta) et insert this tags in the body.
NB: DOCTYPE is not a node but a text.

* [FIX] fields: translations of the help of inherited fields

This is similar to revision 54140331f3c38acaad15c401f118c8fabbdb7bc7

opw-673716

* [FIX] web_tip : remove unused code that can trigger error

* [FIX] account: Exchange test failing on Jun 6

The test `test_balanced_exchanges_gain_loss`
failed on Jun 6, because it created a specific rate
for today's date at midnight
(e.g. on Jun 6, 201x-06-06 00:00:00) for the test purpose,
but a rate is created in the demo data for Jun 6 midnight exactly:
`base.rateUSDbis`, making the test confused about which rate
to use.

We solve this by making the test use the rate `base.rateUSDbis`,
modifying the rate for its own need, instead of creating a new
rate.

* [FIX] product_extended: bom_count field in product template view

To apply this domain ('bom_count', '=', 0) in the product template view,
the field bom_count must be in the view.

opw:679095

* [FIX] *: remove conflict markers from ta.po files

* [FIX] website_event: endDate appeared twice in event_details

endDate appeared twice in event_details

opw:678823

* [FIX] account: Invoices & Refunds filters together

When both selected, these filters are expected
to display Invoices - OR - Refunds.

It was not the case, because the web client
expects to receive the domains normalized
when concatenating domains together with a
`|` statement.

Selecting both filters resulted in the below domain:

```
[
    '|',
    ('state','in',['open','paid']),
    ('type','in',('out_invoice','in_invoice'))`,
    ('state','in',['open','paid']),
    ('type','in',('out_refund','in_refund')),
]
```
Instead of
```
[
    '|',
    '&', ('state','in',['open','paid']), ('type','in',('out_invoice','in_invoice'))`,
    '&', ('state','in',['open','paid']), ('type','in',('out_refund','in_refund')),
]
```

opw-679246

* [FIX] purchase: exclude cancelled invoice for billed qty

The billed quantity field on the purchase order line
must exclude the cancelled invoice, as a cancelled invoice
is not considered as invoiced.

`draft` could be considered as well, but we do not
take the chance now, as this field is used
when creating a new invoice, to determine the
quantity to invoice. Therefore, if there are
draft invoices with some quantities invoiced,
it can make sense to reduce the quantity
in this new invoice. Nevertheless, it must not be the case
for cancelled invoices.

opw-679363

* [FIX] doc: use correct variable in bash example

* [IMP] delivery: allow to set delivery price from XML-RPC call

(a method that returns nothing is not callable through XML-RPC)

Backport of dc043cf1bb4602fb298fca8b8d17765e3a6b93ff to 9.0

Fixes #12289 and tinyerp/erppeek#87

* [CLA] signature for user holdenrehg

Closes #12305

* [CLA] add leemannd to c2c coprorate signature

Closes #12317

* [FIX] hr_evaluation: badly rendered form

The date was positioned inside the h1 and was badly rendered (field too small)
Fixes #2476

* [FIX] account_analytic_analysis: fpos of invoices

When an invoice is created automatically thanks to the cron task, the
superuser is used. However, this implies that the company of the
superuser will be used for the account invoice creation, leading to
potentially incorrect taxes and fiscal positions.

opw-669714

* [FIX] web_calendar: use local format for week in title of calendar view.

Commit odoo/odoo@9be7a9535ca1c5a9884ef06b7a567bf42ebdce0a changes the week number
computation to match calendar and pivot views.

Now, calendar don't use isoWeek format by default, but the weekNumber from locale(),
So we need to adapt also the format for title.

closes #12068, closes #9629

* [FIX] translate: doctype is removed from the backend web template

issue: The rendering is altered because the browser doesn't know how to parse the html and css content

* [FIX] product: pricelist based on supplier price

In the case of a purchase pricelist based on the supplier price, the
price selected is incorrect if the supplier is not in the list of
suppliers of the product. Indeed, in this case, the price of the first
supplier is chosen.

We also need to make sure to go through all the pricelist items found.

opw-678440

* [FIX] web,auth_signup: prevent login autocapitalization

Mobile virtual keyboards will often capitalize the first letter of
an input text field, which is annoying as odoo logins are case-sensitive.
This will no longer happen thanks to this new attribute.

X-port of commit odoo/enterprise@b8632f8bb62c5507c67bf30ca184f06b3ddd1cb3

* [FIX] packaging: redhat: don't write the conf file if already there

this avoid to overwrite the configuration file at each update.

closes  #11722

* [FIX] website_{quote,sale}: payment tx handling consistency

Both website_sale and website_quote have logic to independently
confirm sales orders when a successful payment transaction is
processed.
Rev 46c5f93b6cfa2b348078e674cd9e271ef5f81292 introduced an extra
check and logging for transactions with mismatching amounts in
website_sale, but the same change was not done in website_quote.

Consequently, when both modules were installed, the tx mismatch
check was bypassed by website_quote, and a spurious logging message
was emitted by website_sale if the website_quote logic had executed
first.

This patch makes tx handling consistent in both modules, and avoids
the misleading log message when both modules are installed.

* [FIX] web: prevent search dropdowns to close on click inside

In the Filters, Group By and Favorites dropdowns,
when clicking outside the `li` elements but still
inside the dropdown menu itself
(like on the dividers,
or next to the advanced search `Apply` button),
the dropdowns was closed.

This behavior was annoying when doing an advanced search
with a field using the datetime picker, as, to close the datetime
picker, you have to click outside it, and when you did, it closed
automatically the filter dropdown... So you had to open it again to
finally apply the filter.

opw-674310

* [FIX] sale_timesheet: set wrong code on analytic line

The product_id is the one of the timesheet line, not the one of the order (which
actually is the one of the first line).
Closes #12013

* [FIX] stock: reordering_{min,max}_qty &several ids

dict.fromkeys doesn't duplicate the passed 'values', hence the code
created a table with several times the same instance of values dict.

opw-679203

* [FIX] qweb: t-lang warning logger

The evaluated lang is within the variable
`d.context['lang']`

`lang` contains the non-evaluated `t` attribute,
so, in the case of `report_saleorder`,
`doc.partner_id.lang`

opw-680074

* [FIX] website_portal_sale: prevent overlap

In the website portal summary ('/my/home'), a long invoice number might
overlap the date.

opw-677567

oeiter added a commit to oeiter/odoo that referenced this pull request Jun 8, 2016

Master (#4)
* [FIX] account: statement line amount rounding

See comment in code.

opw-676924

* [IMP] hr_timesheet: inline project and task creation

For the sake of consistency with other views and general usability, the user is allowed to create new tasks and projects from the timesheet lines list view.

* [FIX] mail: to prevent infinite loop

Introduced by fac04424caa095511b0f809b351fc2af0a5942cc

* [FIX] account: duplicate journal should not use the same bank account

There is several override of create and write that assumes that a bank account
is present on only one account (see 4530e5d).
It is very hard to change or remove the account bank once linked to a journal
(see 4a65bc38) so it should not be set in the first place when duplicating a
journal.

opw-676374

* [FIX] stock: correct (de)activation of internal picking types in config wizard

* [FIX] hr_holidays: missing context

Closes #9386, opw-677958

* [FIX] web: company logo file extension

The company logo file extension is always '.png', even if the logo is of
another type such as 'jpg' or 'gif'. This is not an issue for decent
browsers, but IE might not display the image under specific
circumstancies, e.g. in combination with nginx.

opw-676836

* [FIX] web, pos: Lato font assets

A fonts.less file which contains the definition of Lato was created
in saas-11 and placed in the backend assets. It should have replaced
the lato/stylesheet.css in the common assets.

Also adapt point_of_sale assets to use the same file.

* [IMP] doc : expand the coding guidelines

- correct typos
- clarify some points, according to the community comments
- precise the xml notation : record tag vs act_window/menuitem/... tags
- add organization of report, wizard, data/demo, ... (directories and naming conventions)
- new conventions for 'symbols'
- ...

Thanks to @rim-odoo for its grammar extremist review, and @tde-banana-odoo for our long debates about wizard conventions.

* [IMP] doc : add python idioms and odoo specific coding guidelines

- add python idioms
- odoo specific guidelines (for ORM, translations, ...) inspired from old guidelines v6.0
- some other best pratices

* [FIX] web: download file and editor firefox bug

When we download a file (as can be done with attachments in Odoo),
firefox is opening the link in current window but cancel the action once
it is aware the resource is to be downloaded.

But this get firefox into a corrupt state for some contenteditable
features, for example document.queryCommandState which is needed for the
editor will after downloading a file throw an error consistently instead
of working as expected.

It can be reproduced on firefox (at least from version 32 to 46) with
the following snippet:
 https://jsfiddle.net/s246u3ay/3/

The issue is probably linked to the following reported issue since 2005:
 https://bugzilla.mozilla.org/show_bug.cgi?id=297494

This commit avoid the bug by opening attachments download links in a new
window instead of the current one.

closes #12109
opw-676918

* [FIX] mail: typo

This `,` at the end creates a tuple and `if (False,)` will be evaluated to True.
This leads to invalid `Notification Email`.

Hum..

* [CLA] signature for Baldi Leandro (lbaldi)

Closes #12110

* [FIX] l10n_be_intrastat: traceback change new api

642fea4 updated some models to new API but this was not taken into
account into the part of the code this commit fix.

opw-677497

* [FIX] calendar: fetching images of negative ids

The mimetime fetching in /web/image/... may fail if:
- calendar is installed
- `id` is a string (using ?id=42 in the URI)
- `id` is a negative number (company partners on odoo.com)

The `search` override of `ir.attachment` in calendar detects if a number is a
virtual ID when it contains a '-' and is a string.

While it is not optimal to allow both int and str format for paramter `id`, make
the verification of virtual ID in calendar more strict to only match the format
`<real>-<virtual>` and not `-<real>`

* [IMP] calendar: avoid parsing for models that do not have virtual ids

And avoid bug with negative ids to happens in the first place

* [FIX] hr: trigger job count computation on employee archive

opw-676542

* [I18N] Update translation terms from Transifex

* [I18N] Update translation terms from Transifex

* [IMP] event_sale: easier configuration of tickets, no more event_type_id on product as tickets define what you can sell

* [IMP] event_sale: move event_ok on product form to Sales tab

* [IMP] sale,hr_expense: simplify invoice policy, 2 options instead of 3

    The invoice_policy 'time & material' has been replaced by an
    expense_policy!='no', with invoice_policy='delivery'.

* [IMP] sale: SO Line not modifiable if it's a reinvoiceable expense

* [IMP] sale,purchase: done -> lock usability improvement

* [IMP] crm,project,website: improved welcome email content

* [IMP] account_asset: use company dependent fields

Like for most of accounting, these fields should be company dependent
since they generates accounting entries in certain journal & accounts
that depend on the company, while your products usually don't.

* Revert "[FIX] res.currency: allow duplication"

This reverts commit d780f9476d43eb4fd25c852dd4e691002f4a6dcf.

Did not work due to the size=3 on name field that strips the code to the first
three letters only (removing the " (copy)" part).
Copying a currency has a few business cases as the rates are not copied.
As can not increase the size of a field in stable, remove the method that had no
effect.

Fixes #11036

* [FIX] account_asset: depreciation start date

If 'Prorata Temporis' is not set, depreciation_date should be the 1st of
January of purchase year.

opw-677534

* [FIX] account: sort taxes

In the case of grouped taxes, the taxes would not be applied anymore
after commit 0a5b943d19129545724488f6026632bacd66a97b

opw-678158
opw-678219

* [IMP] sale: AA editable if not set

Allow manually creating an analytic account when needed even
when a SO is confirmed, but do not allow changing it once it's set.

* [IMP] sale, sale_timesheet: explicit analytic account creation

Before this revision, a small function in sale was extended by
sale_timesheet to know when to (or not to) create an analytic
account for a SO.

This was nice, but since it was extended only in this module,
there's no real need for the added complexity (*reading
complexity*)

* [FIX] doc: corrects spelling errors for cmdline

From #12028

* [FIX] web: better blur handling in m2m in wizards

Before this commit, many2many list views in wizards did not
handle the blur event at all, which means that the last edited
line was ignored.  This is quite a large bug, but not really
visible in our standard install, because we had no many2many
in wizards.

This commit add naive support for blur events.  This is only
intended to help the MRP team.  A complete solution would
probably involve moving most of the code in One2ManyListView
to X2ManyListView.

* [FIX] mail,website_forum: set SELF_WRITABLE_FIELDS on model's class

Otherwise it is not visible when set on an instance of the new API.
self is a recordset instead of the model `res.users`

Without this patch a low priviledge user was not able to modify its own value
of `notify_email` through the preference window.

* [FIX] stock: typo in onchange

* [FIX] base: partner: compute image before calling create

* [FIX] web,base: m2o empty name results

M2O use the autocomplete lib to display its content. The problem is
that if a result is empty (or only composed of whitespaces), a
divider is displayed in the dropdown.

Commit 1d9f7d279a74aaf6aaf25f91e2313b23b4122827 was fixing this by only displaying non-empty
name results... but it did not work as many models implement the
name_search method the wrong way.

The new solution is to add a default display for record values which
are empty strings, at the right places in the webclient components.

* [FIX] account: invoice import with only partner and lines

When creating a new invoice through the web interface,
a bunch of "default" values are loaded once the partner
chosen, thanks to an onchange on this field,
such as the `account_id`, the fiscal position, etc.

It was not when importing an invoice, making it
more difficult to import an invoice.

In addition, the taxes lines were not computed at all
when importing an invoice with taxes within its
invoice lines, while it should be the case
if the tax lines are not forced during the import.

opw-678155

* [IMP] project: usability, don't filter on favorites by default (e.g. you invite new users, he sees no project)

* [IMP] account: usability, better view for payment terms configuration

* [FIX] account: unlink account journal

The bank account linked to a journal cannot be systematicaly deleted
with its journal because this bank account can be linked to several
journals.

opw:676374

* [FIX] account: partner_id set on a bank fee

Used case:

-Create several customer invoices and validate them
-Register a payment without any partner_id and in a bank statement for an amount
a bit lower than the total of the invoice (the difference is the paypal fees)
-Reconcile the invoices with the payment and create a write-off for the paypal fees
-When you close the bank statement, check the journal items, the paypal fees are
automatically assigned with a partner.

Fix:

-When creating the account move line for the fee, if all the account move lines
linked to the move are for different partners then you cannot determine the partner
of the fee.

opw:674822

* [IMP] analytic: added 'Analytic Accounts Tags' menuitem

And changed account tags menu string. 'Tags' to 'Account Tags'

* [FIX] project_issue: number of issues for a customer

When counting the number of issues for a customer, all the the contacts
of this customer must be taken into account.

opw:676985

* Revert "[FIX] account: fixed old references to account_extra_report module forgotten during the merge into account"

This reverts commit 4f00202fdae2c7ed2a2e31e2a57571ae89f30439.

* [IMP] base: Make footer field translatable

* [IMP] base: add address + phone + email address for admin

And update company on 'street' field and address on 'street2' field for
Admin, demo and demo portal user in base demo data

* [IMP] hr_timesheet,web: Improve the Progress (%) bar on the tasks time management

1. Rename "Progress (%)" into "Working Time Recorded"
2. Remove tooltip.
3. It should always indicate the exact percentage :
	a. if 2 hours planned and 2 hours consumed = 100%
	b. if 2 hours planned and 3 hours consumed= 150%
	c. in both cases the progression bar should simply stay full.
4. Consider sub task hours

* [IMP] base: res_company_form: mouse curson when hover 'here' link.

* [FIX] hr: trigger job count computation on employee archive

forward-port of b9bca7909aee5edd05d1cf81d45a540b7856f76e which have
been forgotten in previous commit.

* [FIX] account: fix error in aged partner balance, variable at_least_one_amount referenced before assignment

* [REM] base: remove improper data of partner title model

Improper abbreviation for the 'Sir' title. 'Sr.' is an abbreviation for Senior.

* [IMP] im_livechat: don't auto-open on mobile

Currently on mobile, the livechat window would take all the viewport of
a small screen mobile browser. This combined with the "auto open"
feature can be desorienting: users could have only seen the "hello, how
may I help you ?" window and not know what to do or what is happening.

So this commit remove the "auto open" feature if user is on a too small
device (the user would thus have to click on "Have a Question").

closes #12148
opw-678012

* [IMP] account_asset: Change the label name 'Every' to 'One entry every'.

* [FIX] website_crm: leads on dashboard

The field sales team is not used on lead when created from website.
We use the UTM (i.e. medium) instead to distinguish where the lead is created from.

* [FIX] website_crm: fix typo in template name

* [IMP] event: Rename 'Event Type' groupby into 'Event Category'

Event type has been rename into Category in the Event app, except in one place.

* [IMP] crm : Rename 'Expected Closing' into 'Expected Closing Date'

* [FIX] *: do not use groups when extending an asset bundle

Using groups when declaring an extension of an asset bundle leads to a
different generated asset bundle according to the user's group. This
is not something we want because a dynamic asset bundle's content
means that it could (and it does) trigger unwanted cache invalidation.

website_event, website_blog, website_forum and website_sale add
functions to `website.contentMenu`. These functions are bound to
server side qweb nodes protected by groups. We can always add the
functions; if a user tries to use the routes he should receive a
traceback because of lack of access rules

website_blog adds a `website_blog.editor` module, but is guarded by
the presence of a node in the DOM. We use the same logic to guard the
module added by website_sale with the `.js_sale` node.

website_gengo is working as expected.

* [FIX] website_mail: publications of internal notes

On the font-end view of project.issue, only the messages of type `note` were
display. This excluded the messages recieved via email which makes hard to
understand a conversation (e.g. a customer does not sees his own answers).

Instead, only filter out the notifications (change of states, responsible...)

opw-677426

* [FIX] account_asset: fiscal year date

The fiscal year start date should be taken into account when calculating
the depreciation amount in case of prorata temporis.

opw-678072

* [FIX] account: Code 421 should be type Payable and not Current Liabilities

To be able to counter part the expense of the employee with the account set on his personal contact form, we need to configure the 421 account as payable.
more infos on http://www.compta-facile.com/comptabilisation-des-notes-de-frais/
The fix allows us to get that correct entry:
https://drive.google.com/a/openerp.com/file/d/0B5t9_ESHwijQemhyUjFFRzdTeVE/view?usp=sharing

* [FIX] account: use new `convert_to_write` api

* [FIX] stock: do not use self in a multi loop

* [FIX] stock: wrong field name in move.split()

* [FIX] stock: quant package: issue with newId

When creating a new stock.quant.package, the method tried to access a key
that does not exist in an intermediate dict. Indeed a new record does not
have an ID available in self.ids.

* [FIX] stock: config: advanced locations settings

If you manage several warehouses with several locations, do not go back to only
one warehouse when choosing advanced routing.

* [FIX] stock: product_strategy: effectively call method

* [FIX] web_editor: snippet colorpicker option

When going over the colorpicker when no bg-* class was selected yet,
the bg-undefined class was added on the snippet.
Also, when clicking on the reset button, the bg-* class was removed
but the selected button in the colorpicker was not unselected.

* [FIX] hr_payroll: avoid infinite recursion

The get_recursive_parent function seemingly depended on the ordering of
the rule_categories recordset which happens to work fine in most cases
because all data first defines the parent before defining the children
rule categories. But if you happen to do it the other way around it
won't work and it will infinitely call itself because:

if rule_categories[0].parent_id:
    rule_categories = rule_categories[0].parent_id | rule_categories

won't change the value of rule_categories[0].

opw-673222 (loosely related)

* [FIX] calendar: editing an existing recurrent event

It is not possible to edit the start_date, end_date, start_datetime,
end_datetime and duration for a recurrent event due to the raesons
explained in https://github.com/odoo/odoo/issues/10278 or see
opw:665700

opw:677139

* [IMP] fields: do not group property fields with 'multi'

Reading N property fields is as costly as reading each field separately.
Reading them one by one makes more sense performance-wise, as you will only
read the ones you need.

* [FIX] stock_account: average cost with foreign currency

Quants are created, and stock moves are updated, with the purchase
value converted at current rates.  However, the product average
was calculated before that value was retrieved.  This ensures
the correct value is retrieved for the average cost calculation
and will match the actual quants.

Fixes #12163
Closes #12164
opw-678511

* [FIX] account: don't write the foreign currency on writeoff when several secondary currencies are involved

* [IMP] Change wording

At this point the error states that a page node must be below a book node, but the correct term is notebook.
This can be confusing for a developer.

* [IMP] product: Product Labels refactoring + make available on templates

Printing the product label is only available on the variants.
It should be available on the product template too as you may not work
with them.

We took the opportunity to refactor the label report too.

* [FIX] web_settings_dashboard: access error

When a user has the access rights "Configuration" or "Access Rights"
regarding the "Administration" module category, the click on the
"Settings" menu leads to an access error.

This is because the dashboard fetches data about the number of installed
modules ("installed_apps"), which requires access to "ir.module.module".
Since it is not easily possible to hide a parts of the dashboard (the
static templates do not recognize the "groups" attribute), we simply
hide the dashboard for these users.

opw-678531

* [IMP] gamification: prevent misconfiguration

Do not allow to select field that will be used read_group but not stored in db

Fixes #8545

* [IMP] website_project_issue: my/issues/id form improvements

1/ Display a button for the project_user to come back in backend and
   edit the issue if they want

* [IMP] website_mail: Display the message.atttachment_ids on message_thread

* [IMP] Appswitcher: Better icons for some modules

For Manufacturing and Repairs, replace the gavel by a wrench. A gavel is a small hammer used by a judge; it is not used in manufacturing. Keep it for when we will have a Law app.

For POS, replace the briefcase by a screen:

For timesheet, replace the calendar by a clock:

For calendar, use the calendar:

For event, use a ticket, it's more generic than a martini glass:

* [FIX] account: Removed duplicated subtotal grouped by tax group

Before a table was displayed to group by the subtotals by tax group.
It has been moved on the right and it is duplicated.

* [FIX] base_import: currency symbol can be placed at the right of the value

The previous code went outside of the list bounds because the modulo
operator has a higher priority than the addition one.

* [FIX] mail: mutiple read more

A read more was added to every node having a mail-quote tag.
However all quotes and their child nodes are tagged, leading to numerous unnecessary read more / read less.
Now, all consecutive mail-quote are joined in one 'read more/read less'.

* [FIX] product_visible_discount: product without company_id

When computing the real price of a product, a currency of reference is
needed, first the currency of the product's company is privileged and
if no company is set on the product then the currency of the user's company
is taken.

opw:678159

* [IMP] product: Add the the sale price on product template list view

product,point_of_sale: Add a widget handle on the sequence, to be able to order the products
easily for the ecommerce for example. (Move it from the PoS module to the
product module)

* [FIX] web: chardomain, don't allow to edit the input when not in edit mode.

* [FIX] website_forum: typo in translation

* [FIX] account: invoice onchange partner accounts properties

Since revision 7eab8e26d3d46c53f4be924d6a34e80a66e74960
the `_onchange_partner_id` of `account.invoice` failed
if the SUPERUSER created an invoice for another company
than his own, and if the partner had not a specific
receivable or payable account (meaning the default
accounts are used, the accounts coming from the properties
of this company without any partner specified)
because
```
prop.search([
             ('name', '=', 'property_account_receivable_id'),
             ('company_id', '=', company_id)
            ])`
```
can return multiple records, if several partners
have their own receivable accounts set, and,
since the above revision,
`get_by_record` specify `ensure_one`, meaning
you cannot pass multiple records to this method.

This domain was built a the time
(2009, rev. 80861660c6fd598c29b3cf6bb044490f2b1feec9)
to handle the multi-company property,
which can now be handle with a simple `force_company`
passed in the context. It was not the case at the time.

This revision could be applied in former releases,
but this is not a necessity. This is a necessity
in saas-10, because of the above revision.

opw-678536

* [IMP] gamification: prevent misconfiguration

Prevent selecting wrong field or models or computed fields

Fixes #8545

* [FIX] im_livechat: don't translate livechat javascript template

* [FIX] translate: don't translate DOCTYPE tag

* [FIX] account: get_formview_id

For a type 'in_refund', the supplier account invoice form must be
taken.

opw:678498

* [FIX] hr_timesheet: app_switcher icon was duplicated

Goal: Display the timesheet icon on the app switcher even if
hr_timesheet_sheet is not installed to be able to acces the Activities
without the full timesheet integration.

* [FIX] im_livechat: don't translate livechat javascript template

* [FIX] translate: don't translate DOCTYPE tag

* [FIX] stock: run scheduler

Issue when trying to access the current company, now correctly set after
the new cursor creation.

* [FIX] point_of_sale: set callbacks for weight and price barcodes

c8732bea1e8471b90ac0c118b212a2d6ae84180a did not take into account that
we don't have specific callbacks for weight or price type
barcodes. Those where handled by the product callback.

opw-678556

* [FIX] web: raise a warning for bad domain

When a user wrote a wrong value in char_domain field it should raise a warning
message instead of a traceback.

Backport of b3a88b6ed846a13c0cd07cc25ea49bccbdf84aa8

opw:676783

* [FIX] calandar: all day events email notification

When sending a notification email to an event attendee
for an all day event, the timezone must be ignored
as the `start` and `stop` datetime are stored as
the day date + '00:00:00'. If the timezone is applied,
for users being in a negative timezone (such as an American
timezone), the day displayed would be the day just before.

opw-677019

* [FIX] crm: merge leads in multi-company

When merging leads with a company set different
than the current user company,
it failed because the notification email (the message
written in the thread summarizing the merge) couldn't
read the company name (the `name_get` call on the company)
because of the multi-company record rule.

`name_get` can be safely called as `sudo`, as it does
nothing else than returning the name of the record. This is
already done for the many2one links in the web client anyway
(You can see leads from a company different than yours,
you can see the company name to which the leads belongs to,
but you can't click on the company many2one link)

opw-677986

* [FIX] web: fix backport #4c7a9bd

* [FIX] translate: don't translate DOCTYPE tag

* [FIX] im_livechat: don't translate livechat javascript template

* [FIX] report: some Wkhtmltopdf installation can return an empty version

* [FIX] web_editor: display background color to translate

* [FIX] gamification: bad backport to 8.0

UserError was defined in version 9, not 8

* [INP] gamification: skip check for not required fields

Could get a definition with a model only

* [CLA] Rock Solid Solutions signs corporate CLA.

Closes #12182

* [FIX] sale: propagate context

Closes #9521

* [FIX] doc: update css file to reflect 8ce16c3

* [IMP] hr_recruitment: specific search view for ir_attachments

- Quick search on index_content field.
- Removed unnecessary filters(My Document(s), url, binary)
- Inherited ir.attachment's search view for that and bind
  it to actions of hr_recruitment.

* [FIX] server: Do not listen when --no-xmlrpc is set

This is a fix for f04f409943b8bd8f4bd2653e368523d1cc0d8246, which only
prevented the workers from being spawned in Prefork mode, while the
socket was still being bound to - this is a problem when starting a
worker-only server as it cannot coexist with the XMLRPC server on the
same machine.

Closes #1828

* [FIX] sale: multi-company tax filtering

When the admin creates a SO, he has access to all taxes (since ir.rules
do not apply to him); therefore in some cases, the SO could be created
with SO lines that have taxes from other companies. This usually does
not make sense.

From this revision on, only taxes that are in the same company as the
SO are applied to the lines. If no company is set, then no filtering
is done.

* [FIX] crm_partner_assign: minimum access rights to employee

Give the same as access rights to the employee as for the public user.
This patch is needed to allow a user to access the partner form.
Same for portal.
The list of grades in not a confidential information.

Fixes #7719

* [FIX] *: replace uses of `except_osv` with `UserError` that have been forgotten during previous forward-ports

* [I18N] im_livechat: export source terms

* Revert "[FIX] translate: don't translate DOCTYPE tag"

This reverts commit 44e8b92beb4d066c6192fd723cff8299f19d9628.

The condition is wrong as a view starting with DOCTYPE as top element will be
excluded, including its child (the whole page them).

Re-add the translatable title that was excluded by the condition.

* [FIX] mail: multiple read more - better heuristic

- wildcard selector for stopSpelling
- <br> tags must not split read more/read less

* [FIX] website: robust attribute checking

When installing website or one of its dependencies directly, the website
attribute is not defined on request. If the installation triggers qweb
rendering [1], we need to correctly check the presence of the website
attribute, which this commit does.

[1]: This is the case in website_blog since
4a132e2afbce4a688afbc72f294e14ad6c7ff8c1

* [FIX] stock_account: use new api to call method `get_price_unit`

* [IMP] report: Printed Report names customization

PURPOSE
=======

I've seen this new improvement regarding the naming of the printed reports:
https://www.odoo.com/web?#id=10870&view_type=form&model=project.task&menu_id=3942&action=327

This makes the report have the pdf name being the name instead of the report_name of
the ir.actions.report.xml, which is already an improvement.

But why don't we allow the users to have their own naming conventions?
I mean, we could allow our client to create and name their pdf the way they want, as
they do regarding the attachment.

Not only when it's about saving it as an attachment on the record, but also when downloading
directly the pdf, such that the modification in the previous screenshot, would give the following
result when downloaded:

People need to have their pdf named automatically according to a convention. When you print 10 sales
order during an hour, you don't want to get lost in having the following:
Devis / Commande.pdf
Devis / Commande(1).pdf
Devis / Commande(2).pdf
Devis / Commande(3).pdf
Devis / Commande(4).pdf
Devis / Commande(5).pdf
Devis / Commande(6).pdf
Devis / Commande(7).pdf

especially when those are for different partners.

* [REM] product_uos: remove module product_uos it is no longer supported (group_uom manage this by default)

* [IMP] fleet: change directory structure according to new api

* [IMP] fleet: migrate to new api (fleet.py). my eye is paining

* [REM] fleet: Remove unused code

* [IMP] website_{portal,portal_sale,project_issue,quote} : add pager for customer documents

This commit adds controller to list documents of customer, with pager and archive
widget to sort documents. Impacted documents are : quotations, sale order,
invoices, and issues.

Portal breadcrumd is improved too : add the home icon, and keep the query
params when using archive widget.

Some editable zones were added to templates, allowing people to customize
their frontend portal.

* [IMP] website_forum: wording

Closes #12124

* [IMP] product: wording

Closes #11977

* [IMP] payment_transfer: term

Closes #11764

* [IMP] account: consistent terminology

Closes #11663

* [MIP stock: wording

This sentence was turned in a way that was making the user reluctant to click on
Apply while this is a normal flow to follow most of the time.

Closes #11763

* [IMP] stock_account: Usability stock accounting settings

It sounds better to call the "Accounting" section of the Inventory app settings
"Stock Accounting" considering it only concerns stock accounting and nothing else.

Closes #8095

* [IMP] crm:Various improvements,
	>In Dashboard/Your pipeline and in Sales/Your Pipeline: Remove the Direct Sales team filter.
	>In the kanban view, if the expected revenu = 0, the "," shouldn't appear.
	>In lead form view, remove the Opportunity header and move Probability under Analysis in Extra Info tab.
	>Rename Your Pipeline into My Pipeline to match the menu entry.

* [IMP] README: add Links

Closes #4764

* [IMP] hr_holidays: show leave duration on calendar view

name pattern like '<Employee_name> on <holiday_status> : <no_days> days'.

* [IMP] hr_recruitment: Remove wrong tooltip

because document_ftp and knowledge management module is doesn't exist anymore.

* [IMP] stock: Hide label Packs and Lots in not enabled

Hide the group in the stock_picking_type form view if in configuration setting:
   - Packages: Record packages used on packing is false
   - Lots: Track lots or serial numbers is false

* [REF] report,web(_editor): services extracted in their own files

session_instance.js moved from framework/ to services/ and renamed into
session.js, which required to change the bundles in report and web_editor
addons.

* [REF] web: move dom_utils to its own file

* [ADD] Product: Product template stat button on product categories

Remove 'sequence' field, and always display alphabetically

* [IMP] sale_timesheet: project on product template is company_dependent

When using sale_timesheet to create tasks in specific project for certain
products, you should be able to set this setting by company.

Indeed, standard ir_rules prevent you from seeing projects from other
companies; therefore it makes little sense to have this field set to
the same value for all companies.

* [IMP] sale_timesheet: ondelete has no effect on company-dependent fields

* [IMP] pos_restaurant: remove background_image from restaurant.floor

Continuation of 267097255e44ffb76f184838d8775195f8fd42f4.

* [IMP] pos_restaurant: remove pos_order_ids from restaurant.table

Wasn't used anywhere, nor are there any plans for it being used in the
near future.

* [IMP] point_of_sale: remove custom account_statement report model

There's no point to it, as we can easily do what we need directly in the
report.

* [FIX] point_of_sale: remove pos_receipt python code

Oversight of 0650047fd59bd5fb28e2ba5f1c9bb47a95295980.

* [IMP] point_of_sale: remove the User's Product report

This particular report was broken for a long time. Instead of fixing it
it was removed because the use case for it is unclear and noone seems to
actually be using it anyway.

* [IMP] web: start session service as soon as possible

* [REF] point_of_sale,web(site): move session info into page source

This commit introduces a mechanism to add information into the session
from a different module, without having to fetch it manually with a rpc.
This is intended to be used with small pieces of info required at the
start of the web client, such as currency informations.

To add information to the session, one can simply inherit from ir.http
and modify the session_info method.

* [IMP] web: move currency rpc to session_info

* [IMP] web: remove rpc call to get module list

It is already in the web client page source (or more precisely, in the
assets_backent bundle)

* [IMP] web: remove useless rpc by user_menu

The UserMenu widget needs the user name, but it is available in the
session informations.

* [IMP] web_analytics: remove rpc to version_info

and put it serverside, in the session info.  This saves 1 rpc for every
connections.

* [IMP] hr_attendance: remove extra rpc

The attendance module needs to know if the user is an employee before
putting itself in the systray.  This commit add the information in the
session infos, and use it directly.

* [FIX] web: incorrect reference to openerp

I assume the problem was introduced by a forward port. But whatever the case, we
should not ever use the variable 'openerp' in jsland.

* [IMP] project: A lot of tasks and issue loading in a production environment, so we can set a default filter for own tasks and own issues.

* [ADD] account_voucher: same receipt behavior than invoices

In the sales receipts :
    - In Sales Receipts : Change the String Date into Bill Date
    - Always display the Journal Items tab
    - In the Journal Items tab :  Display the date. the string should be Accounting Date
    - In draft : There should be an onchange on the accounting date when the bill date is changed
    - In draft : It should be possible to change indenpendently the accounting date
    - The entries should be posted at the accounting date

In the purchase receipts :
    - Always display the Journal Items tab
    - In the Journal Items tab : Change the string Date into Accounting Date
    - In draft : There should be an onchange on the accounting date when the bill date is changed
    - In draft : It should be possible to change indenpendently the accounting date
    - The entries should be posted at the accounting date

* [ADD] base: Add ir_rules for ir_filters

The object ir.filters has no security rules. anyone can access and
delete other people rules.

Add several rules:
- The administrators have all the rights on ir_filters
- An employee can create/modify a filter for him or everyone. But not for someone else
- An employee can delete only delete the filters he created
- A portal/public user can only access the filters for which he's the user

* [ADD] web: add 'is between' operation for dates in search filters

- Add two datepickers to specify a range of date/datetime

* [MOV] google_drive : reoganise module directory

* [MOV] google_drive : move code to split file per model

* [MIG] google_drive : migrate to new api

* [IMP] google_drive : allow to remove drive access token

Before, we submitting empty token field on General Settings, it did not remove the token from database.

* [MOV] google_spreadsheet : reorganize module directory

* [REM] google_spreadsheet: removed unused code

* [MIG] google_spreadsheet : migrate to new api

* [IMP] google_drive : make it use the constant defined in google_account

* [MOV] pos_restaurant : reoganize module directory

* [MOV] pos_restaurant : slip file per models

* [MOV] pos_reprint: reorganize module directory

* [MIG] pos_reprint: migration to new api

* [MIG] pos_restaurant : migration to new api

During migration, remove 'set_background_color' method, to directly use js api.

* [IMP] website_sale: Stock Availability banner on shop/product/id view

An availability selection field with 3 values :
- Display nothing
- In stock
- Warning + a warning message that could be something like 'available with
  a variable delay of 15 days

* [IMP] base: 'ir.actions.server' 'code' field validation constraint

 - Only SAFE CODES (specified in openerp/tools/safe_eval.py) are allowed in server actions
 - Validating basic python errors eg. SyntaxError, IndentationError etc.

* [MOV] portal : reorganize module directory

* [MIG] portal : migration to new api

* [MIG] portal_stock, portal_gamification : migration of xml data

Since there is no python code in these modules, migration consists
in renaming openerp data tag into the odoo one.

* [IMP] project: improvements in configuration,

	>Remove the Sale Service option, because 'sale_service' module doesn't exist anymore.
	>Remove the option "Time on Tasks" and link the Time Scheduling (resource_calendar_id) to Forecast.
	>Hide the Timesheets section if the 'hr_timesheet_sheet' app is not installed.
	>Change the label "Timesheets on Issues" instead of "Timesheets Invoicing".
	>"Timesheets on Issues" shouldn't appear if hr_timesheet_sheet + project_issue apps are not installed.

* [IMP] project: Remove separator to remove space between name and value.

* [RM] crm: Remove the 'color' field from tree as well as form views of 'Lead Tags' because forgot to remove this field and already removed this field from 'Tags' in project module.

* [ADD] hr_timesheet: Display total hours of task in timesheet, added compute field total_hours_spent which is calculate total hours based on task's time spent + sub-tasks hours.

* [FIX] hr: Traceback when assigning a parent department to a department

Comming from the hr module migration.
https://github.com/odoo/odoo/commit/44c62e1b7f02bb43ed75615076bcbbc7195f72d4#diff-7fe5c1ac38eeb355c75fa18a98b62323R271

* [IMP] mail: 'Mark all read' button is not a primary action

In discuss, mark all read is green. It shouldn't because it is not
the primary action.

* [FIX] purchase: typo at field declaration.

Closes #12260

* [FIX] website_slides: Increase Odoo Slides Height.

Change from 16:9 to 4:3

* [IMP] sale: add 'Analytic Tags' field in SO line form

* [IMP] web_calendar: button to hide the mini calendar

- State stored in localStorage
- Mini calendar width fixed and not 25% of webclient's width
- Minor ui tweaks of the mini calendar

* [FIX] (web_)calendar: load events with attendees in domain

Before this rev., the events were loaded twice:
 - once with the date range as domain (and optionally the content of the search
   view),
 - once with the date range and the partner_ids of the sidebar's filters (and
   content of search view).

The first loading was therefore useless, and might also be very costly.

* [IMP] calendar: sidebar filters: remove unnecessary RPCs

* [FIX] calendar: sidebar filters: no many2one if !useContacts

Also don't allow to delete the filters in that case, as they are automatically
computed from the displayed events.

* [IMP] calendar: sidebar filters: avoid duplicating contacts

by blacklisting contacts already in favorites in the Many2One

* [IMP] calendar: sidebar filters: disable filters if active partner

When loading a calendar view with a partner_id in the context, the sidebar's
filters should be disabled by default to only display events related to that
partner.

* [REF] (web_)calendar: mainly sidebar refactoring

Also:
 - keeps unticked filters unticked when deleting a filter or adding a new one
 - correctly tick filters when clicking on the partner's name (that code was
   broken)
 - remove reference to instance.web introduced by a forwardport
 - wrong use of self in CalendarView's init()

* [IMP] event,website_event_question: Copy more fields on duplicate

In the Event App, when we duplicating an event, the email schedule and
Questions also duplicate.

* [IMP] website_event: Improved error message of event registration page

When event is created/finished/cancelled, event registration page shows same error message.
It shouldn't be same. So changed error message for finished/cancelled event.

* [FIX] report: Traceback on print report from wizard.

Go to Product Variant  >> Select any Product Variant >> Print Report Of Price List >> select any Price List
and Click on print button it's gives traceback like:
http://www.awesomescreenshot.com/image/1288867/b6639baf8cb94e3a90ce9d347b3f4f35

Introduced by https://github.com/odoo/odoo/commit/da3d2fb1dc76654e630fba27ca3dcf03002d9431

* [IMP] sale,crm: Rename access right label

Change access right string because when only sale module is install
then string is confusing this access right of the lead or documents.

* [ADD] mail,sale,stock,purchase,event,pos: Source document clickable in chatter

PURPOSE:
The source document should be in the chatter and clickable

NEW MAIL TEMPLATE:
mail: new template 'message_origin_link' with clickable link to origin
Variables to pass:
- origin: the record from which the current record had been created
- self: The current record
Optional:
- edit: If true, the record has been modified. Otherwise it has been created
  from the origin

SPECIFICATION:
Source Document is available in following models
1) After creating SO then Sale to Invoice -> Source Document (After creating Sales Order and then clicking on Create invoice)
2) When procurement is created after SO or MO or Order Point(procurement.order) - > Source Document
3) Stock.picking -> Source Document ( After Creating SO or PO)
4) When Manufacturing Order is Created (mrp.production) -> Source Document (Coming after creating a sale order of product)
5) Event -> Attendees(event.registration) -> Source Document
6) Request For Quotation -> Source Document (After creating Purchase Tender, SO)
7) In Purchase Tender(purchase.requisition) -> Source Document (When a new Purchase Tender is Created)
8) After creating PO then create invoice(vendor bill)-> Source Document
9) After creating Invoice from contract (subscription) - > source Document.
10) Refund invoice from Invoice --> Source Document.
11) Return picking from picking --> Source Document.
12) sale use POS to create invoice and picking -->  Source Document.

MESSAGES TO DISPLAY:
-In Customer Invoice, there is a source document of Sale Order.
 "This Invoice has been created from Sale Order(s): SO001, SO002"

-In Procurement, the source document can be either of Sale Order or Manufacturing Order or Order Point.
 "This procurement is created from: SO001 or MO0001 or OP/0001"

-In Stock Picking, the source document can be either of Sale Order or Purchase Order.
 "This transfer has been created from sales order(s): SO001 or PO0001"

-Create new Sales order of manufactured product , there will be Source Document with that Sale Order number
"This production has been created from procurement(s): WH: Stock -> CustomersMTO"

-When registering for Event from website, Sale Order is Created and it is stored in Source Document,
 "The attendee has been created from Sale order: SO001"

-In RFQ, the source document can be either Purchase Tender or Sale Order or Order Point,
 "This purchase order has been created from purchase requisition(s): TE0001 or SO001 or OP/0001"

-In Purchase Tender, the source document can be either of Sale Order/ Manufacturing Order/ Order Point.
 "This Purchase Requisition has been created from: WH: Stock -> CustomersMTO"

-In Vendor bill, there is a source document of Purchase Order.
 "This Vendor bill has been created from Purchase Order(s): PO0001, PO002"

-When creating refund of invoice
 "This customer invoices refund has been created from customer invoices: INV/2016/0001"

-when create invoice and picking form pos.
 "This invoce has been create from point of sale: MainXX"

* [IMP] web: Navigation improvement in editable list view

1/ On create new record focus field should select already existing value of field,
   So user doesn't have to remove  the old value first and then enter new value.

2/ Avoid the double empty line creation when pressing enter
step to produce
1 Menu Point of Sale > Configuration > Point of Sale switch to form view
2 Tick the box "Cash Control" , the one2many field will be visible
3 Press the "Tab" from keybord , control jumps to "Add an item" button
4 Press "Enter" from keyboad
5 You will see one extra line will be added..

* [ADD] hr_recruitment: added department menu in configuration

* [REVERT] revert web: Navigation improvement in editable list view"

This reverts commit c43a97f353b76e211cad939a1c02c06e8ee724b7.

If you use a setTimeout in your js code, you might want to have a
serious look at what you are doing.  You are almost certainly doing it
wrong.

If you chain a deferred with the number returned from a setTimeout, you
definitely don't know what you are doing.

If you try to fix editable list view by magically adding timeout,
potentially inversing the order of execution, and without understanding
how deferred works, it is clear that you are just changing stuff until
your particular bug disappear in your particular case, and that you have
no idea what other bugs you just introduced.

Please study how deferred works, how the basic JS methods works, learn
what setTimeout returns.  Also, you might want to have a basic
understanding of how and when expressions are evaluated.  For example,
if you cannot explain why a if statement cannot be replaced by a
function, you might want to stop what you are doing and educate yourself.

* [IMP] web: Navigation improvement in editable list view (v2)

1/ On create new record focus field should select already existing value of field,
   So user doesn't have to remove  the old value first and then enter new value.

2/ Forget about it

* [IMP] Survey: Stat button + ability to clean test answers

======
purpose
======

- Allow user directly see the Answers of the Survey from Survey Form view.
- Allow user to Delete all the test answers from Survey Card.

==========
specification
==========

- Add a stat button called "Answers" in the form view of survey with the counter = number of people who have filled it up.
It shows the backend answers because the action button "view results" will show the front end report.
When clicking on it, a group-by Partner will be set.

- On the survey form, add  "Clean test answers" in the action menu

* [IMP] base: remove birthdate field

cf discussion on #2531

* [IMP] website_blog: Add published date, sort posts on this date + frontent filters

=======
Purpose
=======

For now all the views of blog posts sort them based on creation date. This creation date cannot be
changed (even with server actions). This leads to issues in several cases:

- import of old blog posts from a former system -> all the blog posts have the same date, on the website as well
- website visitors see when the blog post has been created, not published...

=============
Functional Spec
=============

Display blog post sorted by publish date in descending order. If the post has not been published yet,
the published date = creation date. When a post is unpublished and then published again, the publish
date should be updated to the last time it is published.

Add a status filter for published/not published blog posts, by default both are active (only visible
for website admin)

* [FIX] account: fixed old references to account_extra_report module forgotten during the merge into account

* [IMP] base,sales_team: Move res_groups and menuitems to sales_team

Purpose:
Having the res_group defined in base and sales_team auto installed
with mail doens't make sense.

- Move the empty res_config class and the related view from
  base_setup to sales_team (base_setup only contains the 'General Settings'
  model and views
- Move the 'sale' related content from product to sale module (Access rights,
  menuitems,...)
- Set sales_team at autoinstall False. The module is installed when needed by
  crm or sale for example
- Set sales_team as a dependency of voip. (Access rights defined for configuration
  purpose)
- Set sales_team ad a dependency of subscription (Access rights issue too)

Rename xmlids accordingly. Example: 'base.group_sale_manager' becomes
sales_team.group_sale_manager.

* [FIX] account: move some ir.model.access to sale module

The groups group_sale_salesman and group_sale_manager have been moved
from the base module to the sales_team module.

* [FIX] payment: Move some ir.rule to website_sale

The group group_sale_salesman has been moved from base to
sales_team.

* Revert "[FIX] payment: Move some ir.rule to website_sale"

This reverts commit 930bea9758df8dbb1652072783f46be6bc6b9e49.

* Revert "[FIX] account: move some ir.model.access to sale module"

This reverts commit 6d33eb037c4450ad12fb142aa8e0cb7de3e6b7c2.

* Revert "[IMP] base,sales_team: Move res_groups and menuitems to sales_team"

This branch need more testing instead of doing 10 fixes. A lot of issues are occuring
when installing modules in different orders.

This reverts commit fa6e415cdb23ce9494487ed672792186157b40e0.

* [IMP] hr_holidays: Several usability improvements

Change the menu tip of Allocation Request, Leaves, Leaves Allocations and Leaves details.
Change the filter name 'Current Year' instead of Current.
The default filter My requests has been removed. (in SAAS10, there is a ir_rule forcing the exact same domain)
And In the m2o field leave type in leave request, change it in to (3 remaining out of 5) instead of like (3/5).

* [IMP] account: added credit card type for liquidities-liabilities accounts

* [FIX] account: a duplicated xmlid reference was overwritting the Chart of Accounts menuitem

* [IMP] sale: set default terms and condition for invoice

Purpose:
Sales general terms should be printed on the invoices when creating an invoice from scratch.
For the moment, the Terms and conditions are linked to the SO.

Moreover, Terms and Conditions are not copied for Down Payments invoices

Specification:
- If the source document is an SO, it should take the Terms and conditions of the SO
  (in all cases, also with down payments)
- If created from scratch, it should take the default Terms and conditions set on the company.

* [IMP] stock: Improve Picking wave usability

Remove no_one group on the Picking waves menu entry.
Add a search on the picking waves in the transfer lists.
Remove the 'Print all Picking' button and add primary button which is 'PRINT' button.

* [IMP] sale_stock: Usability + Form cleaning for sales returns

1/ In Return form Change the string 'To Refund in SO'  to  'To Refund'.
2/ Return form wizard: Reduce the space in header.
3/ Change the button string name 'Reverse' into 'Return'.

* [IMP] account,sale: shipping address on invoice report

PURPOSE:
Display shipping address on invoice, when both addresses are
different ('Invoice Address' and 'Delivery Address').

* [MOV] hr_holidays: reorganize module directory

Also,
- removed unused hr_bel_holidays_2008.xml file
- removed unused action with xml_id 'act_hr_employee_holiday_request_approved' from hr_holidays_views.xml

* [MOV] hr_holidays : move code to split file per models

* [MIG] hr_holidays : migration to new api

* [MIG] hr_holidays: migrate test cases to new api

- removed unnecessary/unused records from existing unittest cases
- converted yml test cases to python unitttest

* [REM] hr_holidays : remove useless doc directory

* [IMP] hr_holidays : rename 'Human Ressource' into 'Leaves App' in warning message.

* [IMP] hr_holidays: make const with working 8h per day

Having the number 8 in the code makes developers wonder 'why this number ?'. Naming it eases tensions in geek's mind.

* [MIG] barcodes: Migrated to new api

* [MOV] barcodes: Reorganised file structure.

* [MIG] barcodes: Simplify selection fields overrides

@tesserB tesserB closed this Jul 25, 2016

@tesserB tesserB deleted the tesserB:master_cmdline_doc branch Jul 25, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.