Commit Graph
101246 Commits
Author SHA1 Message Date
Julien Legros ec444bf091 [FIX] calendar: mail_thread overrides
Since calendar_event overrides read to handle virtual ids, we need to do
the same for mail_thread _get_message_unread and _get_message_needaction
methods. Otherwise virtual ids may end up in the cache and browsing them
would fail.
2016-04-05 18:19:52 +02:00
Martin Trigaux 44c0245a6a [FIX] base_import: example files
SQL dump:
- Recent export with -O to remove owners
- correct poor Ramzy name

purchase order CSV:
- use correct column names
- remove destination and pricelist columns
- first file should not contain order lines
- second file should be same as first + lines
2016-04-05 13:57:44 +02:00
Joren Van Onder 7318ab6710 [FIX] web_calendar: fix read_slice race condition
When quickly changing the range in the calendar view, multiple
asynchronous read_slice requests will be launched. The read_slice
returns the records and sets the ids property on the dataset according
to a set domain, context etc.

This creates a race condition because although the read_slice calls will
be launched in the correct order, there is no guarantee that they will
resolve in the correct order. In practice issues will occur quite
frequently on a slower connection and with a big read followed by a
small read. The big read that matches a lot of records will be slower to
complete than the small read which will result in it resolving later
than the small read. This causes the dataset to not be in sync with the
rest of the view. When you click on an affected event everything will
look fine in the popup, but when clicking on edit the form view will
show a new event instead. The reason for this is that switching to the
form view requires a correct dataset.index, which is set by
dataset.get_id_index(id) which won't exist.

A potential way of fixing this would be guaranteeing the order of
read_slice calls by only allowing one of them to be active at a
time. This would not be ideal because you could end up with a long chain
of read_slice calls when changing the range fast on a slow
connection. In theory the UI would have to block as well then.

Instead of that, we will simply ignore responses to out-of-date
requests. This is done by manually resetting the ids property of the
dataset to its previous value when we detect the range of the calendar
has changed since the read_slice call was launched.

opw-673425
2016-04-05 09:29:53 +02:00
Damien Bouvy 8ae6406a37 [FIX] account: allow forcing company when fetching fpos
The code to fetch the fiscal position of a partner uses ACLs and
ir_rules to select the correct ones, but when calling the function
as admin, multi-company rules flight out the window.

By allowing to force a company in the context, we can get the fpos
as the admin from the pov of any company.
2016-04-04 15:37:22 +02:00
Nicolas Martinelli a0e04afe62 [FIX] purchase: supplier currency
When a supplier is added, the potential change of currency should be
taken into account.

opw-672862
2016-04-04 14:17:41 +02:00
Nicolas Martinelli 7c410c7c12 [FIX] purchase: do not add contact in suppliers
When the PO is related to a contact of a company, the current behavior
is to add the contact in the list of suppliers of the product. However,
there is little chance that this is actually the desired behavior.
Indeed, in most of the cases, this will simply add a lot of useless
suppliers on a product.

The fix is to add the parent company of the contact in the list of
vendors, since `_select_seller` wil also search in the parent companies
to get a purchase price.

opw-672862
2016-04-04 14:17:41 +02:00
Géry Debongnie 3d4954b88f [FIX] web: some float fields silently ignores their changes
We have an interesting problem when editing all custom float fields and all
fields with no explicit digit attributes: the propertiesmixin tries to
check if the number was changed, according to their declared precision.
But for these specific fields, it does not find a digit attribute, and
defaults to 2.  Then, it makes sure that the changes are ignored if the
new value is too close to the old value (with 2 digits precision)

For example, if the user sets the value to 1.234, then save, then change
it to 1.235, then save, the form view will display 1.234 and totally
ignore the change.

Not that handling the digit precision is done in the propertiesmixin and
in the field float widget.  Also, they do different things, and in some
case, may not be the same.   All this logic should be moved to the
fieldfloat widget.
2016-04-04 12:18:17 +02:00
Fabien Pinckaers e49893ab2d [IMP] Balance in Odoo --> Balance in GL 2016-04-01 19:22:13 -07:00
Raphael Collet 7a483a85d4 [FIX] *: do not use computed fields for resizing images
Otherwise recomputation may fail with "record does not exist or has been
deleted" when creating records with a value directly set for e.g.
'image_mediun' on a new product.

The issue comes from the storage of the images.  When creating a product, the
creation of an attachment for storing the field `image_medium` triggers the
recomputation of that field before its dependency `image` is set.  As `image`
is initially null, `image_medium` is recomputed as null, and this deletes the
attachment just created before the latter has completed its creation!  As a
consequence, some code at the end of `create` for the attachment crashes
because the record has been deleted.

The following models have been fixed: `fleet.vehicle.model.brand`,
`hr.employee`, `im_livechat.channel`, `mail.channel`, `payment.acquirer`,
`pos.category`, `product.template`, `product.public.category`, `res.partner`.

opw 666330
Closes #11516
2016-04-02 00:47:57 +02:00
Olivier Dony f6090e69e6 [FIX] ir.attachment: verify mimetypes match w/ contents 2016-04-01 20:44:52 +02:00
Olivier Dony b7b2609328 [FIX] base_import: avoid JS error in callback 2016-04-01 20:44:10 +02:00
Olivier Dony e2d0f1e974 [FIX] base: require wizard for passwd change 2016-04-01 20:42:50 +02:00
Olivier Dony b2c20482c0 [FIX] res.partner: modifying users requires extra access 2016-04-01 20:40:20 +02:00
Olivier Dony 2c13c1ff05 [FIX] res.users: better compatibility of read() override with new API 2016-04-01 20:40:20 +02:00
Christophe Simonis de11d8415a Revert "[FIX] ir.qweb: can't edit t-field content if modified by inherit xpath"
This reverts commit 5ab43773cb.
This commit is not needed anymore since d3557de746.
2016-04-01 18:32:32 +02:00
Christophe Simonis 94af66fe8b [MERGE] forward port of branch saas-6 up to df45a31 2016-04-01 18:31:04 +02:00
Christophe Simonis df45a3128d [MERGE] forward port of branch 8.0 up to 1d0b9da 2016-04-01 18:25:48 +02:00
Denis Ledoux 895e77a336 [FIX] website_quote: utility method to determine the transaction type of an order
The transaction `type` of an order can depend according
to the order.

For instance, if the order leads to recurring payments,
the transaction type became `form_save`
instead of `form`.

This new method allow to easily override this `type` value
for other modules, so the entire button
rendering code does not have to be
copy/pasted.
2016-04-01 14:50:10 +02:00
qdp-odoo 845b1bde7b [FIX] purchase: empty the stock interim account in case of purchase in foreign currency with a fluctuating exchange rate 2016-04-01 14:32:24 +02:00
Nicolas Martinelli 5de3900258 [FIX] project_issue: count issues
If an issue is created without default stage, it is not counted in the
total of issues. However, a task without default stage is counted (see
commit 432c01c0).

Fixes #11398
opw-672380
2016-04-01 11:55:18 +02:00
Nicolas Martinelli b3cfec189b [FIX] project_issue: link to issues
On the project dashboard, a user needs to click exactly on the number or
on the label in order to open the issue list. If the user clicks outside
the text (but still inside the box), the project is open instead.

The reason is because the link is specifically defined on the
number/label. The fix defines the link on the box itself.

Fixes #11396
opw-672380
2016-04-01 11:54:42 +02:00
Yannick Tivisse 2e0f55537f [IMP] website_hr_recruitment: valid email address on jobs/apply page
A public user is currenlty able to enter 'georges.pompidou' as email
address which is obviously not valid. We change the input type ffrom
text to email and let the browser manager the email format
validity
2016-04-01 11:18:09 +02:00
Nicolas Martinelli 1d0b9da3f0 [FIX] project_issue: partner email
When a new issue is created, the partner email is not pre-filled.

Fixes #11395
opw-672380
2016-04-01 11:12:39 +02:00
Christophe Matthieu d3557de746 [FIX] ir.qweb: branding breaks editing/inheritance
Could not edit t-field content if modified by inherit xpath,
and could not inherit qweb views with non "xpath" nodes with
`position="attributes"`.

Examples:
Can't edit: `<data><xpath expr="div[@t-field='object.test']"
position="replace"><div t-field="object.test"/></xpath></data>`

Inherit doesn't work: `<data><h1 position="replace"/><h1
class="test">tata</h1></data>`

Closes #11561
Closes #11547
2016-03-31 18:11:02 +02:00
Nicolas Martinelli 2e4777bb32 [FIX] account, purchase: price_unit as Float
The price unit on the account move line is defined as a monetary field.
However, on a Sales Order or on a Purchase Order, the price unit is
defined as a float with precision 'Product Price'. Therefore, when an
invoice is generated from a SO or a PO, inconsistencies arise if the
product price precision is larger than the currency precision.

opw-673251
2016-03-31 17:08:37 +02:00
Goffin Simon b44cb82c1b [FIX] account, stock: date invoice for a refund
When a a refund is created from an open invoice and a different
date than today is selected as refund date, the invoice date of
this refund must be the selected date.

opw:673369
2016-03-31 14:18:02 +02:00
Nicolas Martinelli 81748478bc [FIX] purchase, purchase_requisition: make_po
When a product is set up to generate a purchase tender instead of a
purchase order, the associated procurement is set in exception.

This is because the result of `make_po` is returned by the method `_run`,
and the result of `_run` is used to determine if the procurement is
running or in exception. Since a purchase tender does not generate the PO,
the method `make_po` returns an empty list, and therefore the procurement
is considered as in exception.

The fix is to return the procurement_id instead if a purchase order or a
purchase tender has been created.

opw-672170
2016-03-31 12:54:49 +02:00
Nicolas Martinelli 41c42e8623 [FIX] stock: run procurement once
The call to the method `run` is executed at the procurement creation if the
key `procurement_autorun_defer` is not in the context. This is not
necessary since the call to `run` is explicitly done afterwards.

opw-672170
2016-03-31 12:54:49 +02:00
Olivier Dony 26b8bf52d0 [FIX] web: typo in 88594416a6 2016-03-31 12:53:25 +02:00
Goffin Simon bbb317c547 [FIX] crm: merge partner
It is not allowed to merge a partner with one of his parent.

opw:673104
2016-03-31 11:54:25 +02:00
Cedric Snauwaert 90650245d0 [FIX] account: update-check should allow aml with debit=credit=0
Problem: if we try to validate an invoice with a line with a discount of 100%,
this will create an aml with debit=credit=0 and reconciled flag as True.
So when trying to cancel invoice, it is not possible because the check tell us
that there is an entry which is reconciled and we can't unreconcile that entry,
so the check should just ignore line with debit-credit=0.
Also add readonly to general_account_id related field on account.analytic.line.
This is to prevent a write while creating the account_move_line in the case of an
invoice with analytic account.
2016-03-31 10:31:29 +02:00
Denis Ledoux 6e07ae5a5c [FIX] google_drive: Generate Google Authorization Code URL
When checking `Attach Google documents to any record`
in the general settings, if you are not redirected
to a module, but, instead, the current page is refreshed
(the wizard is reloaded instead of creating a new
configuration wizard),
the default value for `google_drive_uri` was not correctly
loaded, the `client_id` in the URL
remained `False` because the wizard was not being
re-created, but reloaded,
and therefore `default_get` hasn't been re-called,
and the `client_id` changed
(it was added to the system parameters after
the installation of the module)

Therefore, the link did not include the correct
`client_id`, and it leaded to the inabibility
to use the URL:
401. That’s an error.
The OAuth client was not found.

Replacing the simple char fields by a function
field, with the correct store trigger,
force the URL value to be reloaded
when the system parameter is inserted.

opw-673274
2016-03-30 16:15:36 +02:00
Nicolas Martinelli fd8570770d [FIX] website_portal_sale, website_sale_(*): access to orders
When a user tries to access one of his orders, the order is shown empty.
This is due to the domain which is applied as an "access check" attempt
and might filter out the order.

The fix directly checks the access rights of the user regarding the
sales order, and return a '403' code if necessary.

opw-671107
2016-03-30 13:33:33 +02:00
Denis Ledoux 4b6218874a [FIX] account: re-introduce get_formview_id for invoices
`get_formview_id` returns a view id to open
the document with. This method is meant to be
overridden in addons that want to give
specific view ids for example.

A link to an invoice must open a different form view
according if this is a customer or a vendor invoice.

This is handled by overriding `get_formview_id`
and returning the view id that should be used
according to something in the record
(e.g. according to the `type` field).

It was present in 8.0, it was somehow
removed in Odoo 9.0 during the refactoring
of the accounting modules, probably
for a wrong reason.

opw-673246
2016-03-30 13:26:19 +02:00
Denis Ledoux 8bb6704b4b [FIX] rating: rating as public
If the user is not connected with his portal account,
but has the right token to rate,
he should be able to.

opw-673231
2016-03-30 12:06:18 +02:00
Goffin Simon 1b5c2ced45 [FIX] website_mail: internal mail messages
The portal user and the public user don't have to see the internal mail messages
linked to a quotation.

opw:672373
2016-03-30 11:30:14 +02:00
Denis Ledoux 69fa2d5662 [MERGE] forward port of branch saas-6 up to 8f1782b 2016-03-30 11:23:18 +02:00
Denis Ledoux 8f1782bd05 [MERGE] forward port of branch 8.0 up to 1d5db336 2016-03-30 11:08:57 +02:00
Denis Ledoux 1d5db33638 [FIX] website_sale: perform onchange as sudo
This revision is related to 9752aedb4e

It looks like in some cases, the user cannot read the
partner associated to his own cart.

This is the case when shopping without being signed in.

opw-673187
2016-03-30 11:06:08 +02:00
Nicolas Lempereur b21382bdd1 [FIX] web_editor: Cannot read property 'left' of undefined
This issue happen for example on a full runbot when clicking with
shift + key pressed on a sale order not in an editable.

We can see that initial_data.rect is only defined in mousedown when the
click target is inside an editable block, hence it could lead to an
issue otherwise.

closes #11527
2016-03-30 09:56:23 +02:00
Nicolas Lempereur 109c529c49 [IMP] web_editor: inline buttons shown over topbar
Before 9.0 web_editor separation in 8c55904, some style would make
inline button be visible over topbar.

This commit reintroduce that and also make the margin over the inline
editor content a little bigger (so the inline buttons on the top of a
content will cover a little less the topbar).

closes #11526
opw-671649
2016-03-30 09:54:05 +02:00
Goffin Simon 0d2d1dbca2 [FIX] website_portal_sale: amount due in Invoices and Payments template
The amount displayed in the website(my account) for the invoices must be
the amount due and clicking on payment button let the customer paying
this amount.

opw:671234
2016-03-30 09:34:52 +02:00
Goffin Simon cfe6716e11 [FIX] hr_payroll_account: onchange_contract
Journal on payslip has to be taken from employee's contract if it is set.

fixes #11188
2016-03-30 09:21:53 +02:00
Olivier Dony ae015cc9c5 [FIX] pricelist: no early rounding of computed price
The pricelist computation should not immediately
apply the currency rounding to computed prices,
to allow for unit prices with arbitrary precisions.

This way users can use a higher decimal precision
for "Product Price" than what is allowed for their
currency. This is useful e.g. to obtain exact
subtotals prices when combining small prices with
large quantities.

The resulting price will be rounded appropriately
when it gets stored to the destination field anyway.
2016-03-30 03:50:13 +02:00
Olivier Dony 742c7b4c2f [FIX] website_event_track: use image_medium avatar
The default image field is usally too large for use
as a speaker avatar.
The implementation of the field should have been
a simple "related" field too, instead of a custom
computed field.
2016-03-30 03:47:24 +02:00
Olivier Dony 5b5324cb9f [FIX] website_forum: avatar route now uses 128x128 image
Many users upload large images for their avatar
(multi-Mb files). This makes most forum pages
longer to load than necessary, and wastes bandwidth.

128x128 images (`image_medium` field) are sufficient
for displaying avatar pictures on posts and profiles.
2016-03-30 03:47:23 +02:00
Olivier Dony 88594416a6 [FIX] web: CSV export: avoid triggering formulas
When exporting text data in CSV format, values
beginning with '=', '+' or '-' will usually be
mistaken by spreadsheet applications as formulas
upon CSV import.
That will often cause the cell to display an
error message instead of the actual contents,
such as "#NAME?"

Prefixing them with a single quote makes them
pure text cells. The special single quote
character is usually hidden by the spreadsheet
in that case.

Numbers and other types of values are not affected.
2016-03-30 03:43:40 +02:00
Denis Ledoux 461162f3ec [FIX] calendar: display_start and stop are not private
Add `display_start` and `display_stop` to the fields
which are public even if the event is marked as private.

There is no reason it should be public,
especially if `start` and `stop` are. Besides,
this leads to issues in
`get_search_fields`, when doing:
```
sort_fields['sort_start'] = browse_event['display_start'].replace(' ', '').replace('-', '')
```
opw-672997
2016-03-29 16:13:07 +02:00
Nicolas Martinelli 04f896b135 [FIX] warning: onchange_partner_id
When the warning module is installed, `onchange_picking_type` is not
called anymore.

When the method `onchange_picking_type` was introduced, it was not taken
into account that the warning module would change the onchange property
on the `partner_id` field thanks to the method `onchange_partner_id`.

opw-672091
Fixes #11342
2016-03-29 16:00:31 +02:00
Nicolas Lempereur 9be7a9535c [IMP] web_calendar: matching pivot and calendar week number
To format Week numbers in the pivot view, babel is used with format
`'W'w YYYY` in the current locale (eg: en_US) which will determine
print the week in the locale week numbering type.

This is inconsistant with the fullcalendar version (1.6.4) in Odoo until
at least version 9.0 where ISO is used by default. This behaviour has
been changed in more recent version of fullcalendar and is now in tune
with pivot view, but updating fullcalendar should be done in master.

This commit customize the week numbering on the old version of
fullcalendar getting the yearned result without updating fullcalendar.

This is only possible in saas-6 since momentjs is only present since
saas-6 and is required for this fix.

closes #11522
opw-653671
opw-668711
2016-03-29 14:23:00 +02:00