Commit Graph

83260 Commits

Author SHA1 Message Date
Nicolas Martinelli 7b7b0d148a [FIX] sale_margin: purchase price calculated using the currency of the price type
When the margin is calculated, the purchase price is calculated using the currency of the price
type 'standard_price' instead of the currency of the company, since they can be different.
opw: 631884
2015-04-09 08:20:36 +02:00
Somesh Khare c09095cbc9 [FiX] sale(_stock): missing state on report
The state 'Quotation Sent' was not visible on the sales analysis report (e.g.
group by Status). Add the missing state to the report to correctly disaply it.
opw 619748
2015-04-08 16:36:04 +02:00
Olivier Dony 56c95d2843 [FIX] report_sxw: setLang() should discard browse_record cache
`setLang` alters the "browse" context of the documents
being printed, but it must also discard any values
already cached, as they could be using a different language.
This is the case when the report uses translatable fields
on `res.partner`, because `setLang` is usually called
with the target partner language, hence prefetching
the translatable fields with the user's language instead
of the partner's language.

E.g. `setLang(o.partner_id.lang)` will cache any
translatable field on `o.partner_id` in the language of
the *user*, not the *partner*.
2015-04-07 18:33:49 +02:00
Ravi Gohil ffacce7140 [FIX] orm: export on empty one2many
When exporting the content of a one2many, if the first row got an empty value,
it was filled with the name_get of all lines and skipped the next lines.
The guessed reason of this was for the representation of the m2m lines but was
left after a proper export of m2m has been implemented (91cafbe).
This code was problematic as it prevented to properly export records with
an empty value on the first line (e.g. credit amount on account.move.line).
Fixes #4218, opw 620178
2015-04-07 15:54:01 +02:00
Christophe Simonis 59d82e6fe7 [MERGE] forward port of branch 7.0 up to 5042d91 2015-04-07 13:36:01 +02:00
Christophe Simonis 5042d91330 [FIX] base: translation update
When updating translations, the source (`src`) is irrelevant for
`field` and `help` translations. Theses translation types are only
matched through their `name`.
2015-04-07 12:37:11 +02:00
Christophe Combelles 3d11e6fae3 [FIX] ir_mail_server: _get_default_bounce_address
fails due to ir.config_parameter permission

At rev. 80017b04c2
ir.config_parameter model has been restricted to employees

Getting parameter from this model should therefore
be done as SUPERUSER_ID where the uid could
be a user which is not an employee.

Closes #5280
2015-04-03 12:54:25 +02:00
Denis Ledoux eaad70daac [FIX] ir_attachment: upload of attachment for non-employees
This rev. is related to eb9113c04d

if a model or a resource id is not defined on an attachment
restrict access to employees only if the creator
of this attachment is not the current user.

So non-employees can access their attachments without
models/resource id, which includes attachment of
discussions threads.

Fixes #4309
Closes #4310
2015-04-03 12:44:44 +02:00
Goffin Simon 3bd29a3483 [FIX] mail: display messages in chatter of inactive records
The method search inside _find_allowed_model_wise must consider records with active field=True.

opw:630295
2015-04-02 16:39:11 +02:00
Martin Trigaux 49e7e67a27 [FIX] mrp: allow same product on different bom line
Relax the constraint on BoM to allow to have two different lines with the same
product. As the error message says, the purpose of the constraint was to forbid
having the manufactured product as one of the components but had this side
effect.
Such scenario of the same product twice makes sense when using the date
attributes on the lines (e.g. changing quantities)
opw 621468
2015-04-02 16:06:14 +02:00
Christophe Simonis 12f600cec9 [MERGE] forward port of branch 7.0 up to 35077af 2015-04-01 19:07:59 +02:00
Nicolas Lempereur 35077af57d [FIX] opportunity: salesperson not in followers
Previously, when updating subscribers of a mail.thread, the default_{key}
arguments could override a {key} in the values.

e.g: for an new opportunity, the salesperson was overrided by the default user_id

This fix gives the priority to the values over the default_ in context.

opw-631741
2015-04-01 16:37:01 +02:00
Cedric Snauwaert 80d3adc1f3 [FIX] web: when converting a node back to xml, correctly escape node content 2015-04-01 11:02:31 +02:00
Goffin Simon 680e6889b1 [FIX] account: Partner Ledger wizard didn't consider all filters and type of entries:
The report generated by this wizard considered all the partners without taking into account
the filters and target entries set.
To show the right partner the function _set_context
must consider the "self.query" which sets the period, the dates, the states, the accounts and
the journals of the sql query used to give the demanded partner.

opw:631649
2015-04-01 08:53:55 +02:00
Martin Trigaux 1219b56bcc [FIX] project: change view according to project uom
The working time unit can either be hours or days. In case of days, should
replace the references to hours in the view to days. In case of days, use float
field instead of float_time.

Using the string 'Hours' as a way to determine the unit is too weak as:
1. it does not work in other language than english
2. if the unit is renamed (*cough* 1626eca *cough*), it will fail as well

Using the object with context to compare strings in the user language.
lp:1080191, opw 595397
2015-03-31 16:01:14 +02:00
Martin Trigaux f7234f3cea [FIX] project: correctly set progress of task
When setting a task as done, the state is done and the progress written to 100%.
If this task is reopened, the progress was not resetted as the stage is changed
but not the state (still done).
Partially backport behaviour of 8.0 (8fbfc997) by using the fold attribute
instead of the state to reset the progress.
opw 597688
2015-03-31 14:12:14 +02:00
Martin Trigaux 23918ae97d [FIX] purchase: remove duplicated filter
Same name, same domain, different string...
opw 597964
2015-03-31 12:08:55 +02:00
Denis Ledoux 31e10ec0a0 [FIX] account: multi-company partner ledger.
If a customer changed of company while having
account.move.line records in the former company he was in
It wasn't possible for someone else than the admin
to print the partner ledger report including this partner.

opw-631800
2015-03-31 11:04:40 +02:00
Denis Ledoux e311a423cd [FIX] product: ratio help tooltip according to type in UOMs
In the form view of a unit of measure,
if the unit of measure was of type
"Bigger than the reference unit"
The help in the tooltip of the ratio field was wrong
Besides, this help message was contradictory
with the formula written just below the field.

opw-631672
2015-03-31 11:01:36 +02:00
han-odoo 0a1f52ccb5 [FIX] account: prevent removing closing entries for closed period
As the target period is closed, should not be able to delete closing entries.
opw 610428
2015-03-30 17:10:16 +02:00
Rifakathusen Haradwala 3cae2c5155 [FIX] account: wrong tax amount for manual tax line
On an invoice, tax lines are generated in tax_line field. When modifying
manually the tax amount, the recomputed tax_amount field was incorrect in
multicurrency environment, leading to an entry with different tax amount and
debit value.
opw 611474
2015-03-30 16:43:08 +02:00
Monica 2b7a6e2933 [FIX] purchase_requisition: avoid errors on service based requisitions
When the product type is Service, the procurement doesn't have stock move.
Confirming the purchase order linked to such procurement would fail.
2015-03-27 16:09:35 +01:00
Christophe Simonis ce690649e9 [MERGE] forward port of branch 7.0 up to 2a0c018 2015-03-26 17:56:05 +01:00
Nicolas Lempereur 2a0c018043 [FIX] kanban: search more when DataSetStatic
When showing a kanban, there is differences between dataset of types:

* DataSetStatic: self.view.dataset===self.dataset, their ids attributes are the entire ids list,
* DataSet and DataSetSearch: self.view.dataset.ids are the already in the view ids, self.dataset.ids are the last gotten ids.

Hence with DataSetStatic dataset, when self.view.dataset.ids.splice(0) is done
self.dataset.ids is also emptied. And in the read_slice function, the slice is
done on that (now empty) array.

This fix removes the splicing of this ids array (which doesn't change a thing
since the array is overwritten latter), a _.difference is used to remove
eventual duplicates since in the DataSetStatic case, the same array is being
concatenated to itself

opw-630654 opw-617090 opw-619563
2015-03-26 17:28:02 +01:00
Jérome Maes f89c4cd78d [FIX] document : keep order during the search of ir.attachment
Backport of 16fa24d52258245af4ee9100666bae6ebe664046
2015-03-26 14:48:18 +01:00
Goffin Simon d79a1622bb [FIX] base: ir_filters: filters not in the language of the user
the context of the user must be used in get_filters to take into account
the language of the user.

opw:630057
2015-03-26 13:18:19 +01:00
Nicolas Lempereur aaf9badbce [FIX] account: context/domain in move line tree
On a line write in a account.move.line tree view, the on_write return all the
sibling move lines of the written move line. The lines are then displayed even
if they do not match the current search domain.

This fix adds the context on the given on_write callback request, and in
on_create_write use a on_write_domain in this context to filter the returned ids.

fixes #3161, closes #5727

opw-630093
2015-03-26 08:59:23 +01:00
Christophe Simonis 6b70b80a0e [MERGE] forward port of branch 7.0 up to 881c10b 2015-03-25 17:41:53 +01:00
Loïc BELLIER 881c10b8ec [FIX] mrp: group attribute position
group_mrp_properties is intended for the property_ids field only, not the other
parts in the "Properties" page (probably wrongly named)
2015-03-25 15:25:22 +01:00
Denis Ledoux a93ef48a70 [FIX] base: access to preferences menu for portal users
Since revs 53582c2ea6 & f65c913027,
this was no more possible for portal users to read groups
on purpose, for privacy reasons.

fields_get of res.users model is overriden, for
the access rights form view features
(The groups selections and checkboxes).
At each call to fields_get, which happens at each call
to fields_view_get on the res.users model, operations are
done on the model res.groups (basically, to
build the selection groups and checkboxes). So,
each time a view of model res.users is displayed,
whatever the view, operations on res.group model were performed.

The thing is, these operations on res.groups
are actually needed only for the user access rights
view, or at least only for users having the group
Administration > Access rights. These group operations
aren't needed for the preferences view, nor for portal users.

We therefore avoid to do these if the user is not part of the
Administration > Access rights group, which lead to
performances improvment, and solves the fact
portal users couldn't access their user preferences view.

opw-627391
2015-03-24 18:25:13 +01:00
Goffin Simon a36396b192 [FIX] sale: based amount to compute advanced invoices
The based amount to compute advanced invoices must be the amount_untaxed.

opw:630975
2015-03-24 10:00:45 +01:00
Denis Ledoux 132afa981b [FIX] mail: is_read is the column name in 8.0.
The column 'read' has been renamed 'is_read' in Odoo 8.0.
2015-03-23 15:46:32 +01:00
Denis Ledoux 3235eda781 [FIX] mail: notify parent message on message auto subscribe.
When auto subscribing to a message
(For instance, change the ```user_id``` field on a record,
like an invoice)
The new user is notified of the last message of the thread.
He must be notified of the parent message as well,
to have access to the first message of the thread,
to prevent access rights issues to the thread.

This mechanism is applied in the _notify method
of model ```mail.message``` as well, for the same reasons.

opw-630286
2015-03-23 15:26:41 +01:00
Denis Ledoux 0c16c20c68 [FIX] hr_timesheet: timezone of anayltic sheets in sheet summary
The timezone of hr_analytic_sheet should be the timezone
of the employee as well, so sheet analytic lines and attendances
lines are grouped within the same timezone, the timezone
of the employees, so the time difference between the analytic
lines and the attendances lines can be properly computed.

Fixes #5809
Fixes #5379
Related to rev. 3bf1615ad4
2015-03-23 15:26:41 +01:00
Nicolas Martinelli aac5c47980 [FIX] l10n_be_invoice_bba: only check BBA when modified
The BBA communication is now only checked when provided as input
(created or modified).
Avoids useless check for uniqueness when it's not modified, and
prevent errors when several invoices are modified in batch.

opw: 629649

Closes #5700
2015-03-23 11:06:14 +01:00
Nicolas Martinelli 1b2c400fc1 [FIX] account_voucher: consistency between exchange rate account and company
In the accounting settings, we prevent having gain and loss accounts that are linked to a
different company than the one selected for the chart of account.

opw: 630494
2015-03-20 15:01:48 +01:00
Nicolas Martinelli 52649934e3 [FIX] mrp: constraints capacity_per_cycle to be strictly positive
A capacity per cycle only makes sense if it is strictly positive. This also prevents to
divide by zero in _bom_explode.
2015-03-19 11:33:04 +01:00
Nicolas Lempereur b97578f689 [FIX] view_form: sequence at item creation
The sequence for new items in some models is simply set to a constant 10.
Hence if 3 items had after reordering sequences 10, 11 and 12. If a new item is
added, it would get after saving at the second position.

This fix set the sequence of a new item to the maximum+1 or minimum-1 sequence
of current items sequences (max if tree has editable="bottom", min if tree has
editable="top").

opw-627830
2015-03-19 09:56:12 +01:00
Christophe Simonis b79f64f1f8 [MERGE] forward port of branch 7.0 up to e1daaff 2015-03-18 12:52:33 +01:00
Nicolas Lempereur e1daaff8e0 [FIX] kanban: propagate context of many2many field
Propagate the context in kanban view when displaying a many2many field.

fixes #5623, closes #5681

opw-629698
2015-03-18 12:32:24 +01:00
Goffin Simon e2ccc5709b [FIX] account_asset: wrong currency to compute the residual amount of an asset
The result of the residual amount of an asset is : asset.purchase_value - amount - asset.salvage_value
where purchase_value and asset.salvage_value are in the currency of the asset. Amount is the difference
between debit and credit of an account move line expressed in the currency of the company.
This is why the amount must be convert in the currency of the asset.
2015-03-17 08:51:43 +01:00
David Monjoie 373b560511 [FIX] account: added check if country has a code
It is possible, if the user created a new country by himself, to have a country without a code, we then need to check that.

Fixes opw 629891, where the customer wrote "Belgie" trying to find "België", didn't find it and created a new "Belgie" country without code.
2015-03-16 10:35:01 +01:00
Goffin Simon 2606e37b18 [FIX] account_asset: currency problem with depreciation in asset management
The amount used to create an account asset depreciation line must be in
the currency of the asset.
opw: 628663
2015-03-16 09:28:24 +01:00
Goffin Simon 4530faae8b [FIX] account_payment: compute amount to pay
compute the amount_to_pay with  function field amount_residual on
account.move.line

opw:628903, 628428
2015-03-13 14:09:46 +01:00
Nicolas Martinelli 2275af4b77 [FIX] base: ir sequence number is now reset to the requested value when calling the write method
opw: 626974
2015-03-11 11:35:25 +01:00
Olivier Dony edcbf067d6 [FIX] workflow.workitem: deleting a subflow should never cascade to workitems
It's always dangerous because (cascade-)deleting workitems
has a great chance of killing the workflow instances they
belong to, putting the records in the workflow limbo
permanently. (They will appear stuck as they don't have
enough workitems anymore)

In addition, in some rare cases a subflow activity is
converted into a regular activity during an update, and
nullifying the `subflow_id` column is all there is to
fixing the corresponding workitems. It will simply take
them out of their subflow, and back into the main flow.

This is the case for the modification of the purchase.order
workflow in Odoo 8 (saas-5), for the picking subflow.
2015-03-10 19:35:23 +01:00
Christophe Simonis f8a94057e5 [MERGE] forward port of branch 7.0 up to a5e3269 2015-03-10 17:51:16 +01:00
Nicolas Lempereur a5e32690b0 [FIX] tests: UTC used in test when it should not
The test for account followup use UTC time, but the default `date_maturity`
and `date_due` of an account invoice come from fields.Date.context_today`.

One failing test for project_timesheet also used `today` instead of
`context_today`.

So depending on the test user timezone, an error of one day (if UTC time
and user time are on different day) occured which failed the tests.

For example:

* user has GMT+1 timezone, test fails 0:00am–1:00am (11:00pm-0:00am in UTC)
* user has GMT+3 timezone, test fails 0:00am–3:00am (9:00pm-0:00am in UTC)

This fix removes UTC use in the tests.
2015-03-10 17:33:43 +01:00
David Monjoie 6758b4cfc5 [FIX][REF] purchase: prevent confirming order if no stockable item
After discussing with jco, we decided to keep it simple and have a coherent behavior between different versions, we then changed the behavior from the one of jbefficient PR at 92adf673f7.
2015-03-10 14:22:32 +01:00
Nicolas Martinelli 2cc09e86af [FIX] web: on_change event on one2many fields was not fired if an attribute is mandatory (courtesy of Christophe Matthieu)
opw: 626974
2015-03-09 16:20:36 +01:00