Backport of 8.0 code, rev f61339b
Create a new journal item with an tax included, the automatically created tax
line had the amount computed as tax excluded.
Fixes#3731, opw 618305
The context wasn't defined in the below methods:
- action_production_end
- action_in_production
while it is defined in the base methods, in the mrp module.
This doesn't lead to any issue in standard
modules, but it prevents to correctly
override these methods within custom modules
when mrp_operations is installed.
opw-632425
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
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
`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*.
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
When updating translations, the source (`src`) is irrelevant for
`field` and `help` translations. Theses translation types are only
matched through their `name`.
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
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#4309Closes#4310
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
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
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
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
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
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
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
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
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
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
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
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
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#5809Fixes#5379
Related to rev. 3bf1615ad4
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
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
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
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.
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.