I hereby confirm I have signed the CLA and read the PR guidelines at
www.odoo.com/submit-pr
(yes, github mutilates nicknames with underscores)
Closes#13875
During the conversion to the new api,
the method `product.uom`.`_compute_price` has had its signature
changed.
Formerly, it was:
`def _compute_price(self, cr, uid, from_uom_id, price, to_uom_id=False):`
Now, it is:
`def _compute_price(self, price, to_unit):`
Basically:
- the first argument `from_uom_id` is removed, and you now should
call this method from the model record directly
- the last argument is no longer a kwargs
Some calls to this method were still done the former way:
- Some have been added during forward ports
- Some are oversights when this method has been converted to the new api
This revision corrects the calls that were still done the former way
to the new way.
opw-694871
When refunding a supplier invoice with tax cash basis and no cash flow,
a movement for the cash basis tax was created.
Only entries with cash flow must be created for cash basis taxes.
opw:693453
Commit 0b87f76628 introduced in 9 some new
controllers in hr holidays. They are used to activate some workflow signals
through dedicated controllers.
However hr holidays workflow have been removed meanwhile at commit
6a8e4c6119. This commit fixes the forward-port
by correctling calling methods instead of trigerring workflow signals.
With a9bd9ab1 the access action was refined depending on the user.
But when sending a mail about a sale order, this lead to an issue since
a mail template is rendered with the current user and not the mail
recipients.
So in the case of a sale order, the recipient could not have a button
leading to /my/orders/{order_id} whilst he should have, because the
user used to render the mail was the sender (which was an employee and
not a share user).
This commit adds a context key "force_website" which force the action to
an available /my/orders even if the sender is not a share user.
opw-691040
In some cases, when the destoy method of 'Tip' calls the off() function on
'$breathing', even if this one is not defined.
To fix this error, we check that '$breathing' is not 'undefined' before
calling off() on it.
When we are trying to use the button 'set date to all order lines, we
get a traceback saying, that update cannot be done, because it ensure
that there's only one record. (After 9.0, there is no more this
'ensure_one').
This bug has been introduced in rev: https://github.com/odoo/odoo/commit/401a3cfaf6fd09f594e45c181e908900acba3777
To fix it, we iterate over the order lines, and do the update of each
line.
When tax cash basis is used, the user might face the error "Wrong credit
or debit value in accounting entry !". A detailed use case can be found
in issue #14158.
The reason is that a float representation of `1.0` of the field
`matched_percentage` will become `1.000...2` when used in Python.
Therefore, such an expression such as `line.credit_cash_basis -
line.credit * matched_percentage` might lead to a slightly negative
value for the credit/debit, which will not pass the condition `CHECK
(credit+debit>=0)`.
Fixes#14158
opw-692797
More information from https://en.wikipedia.org/wiki/Decimal_mark section:
"examples of use"
`The following examples show the decimal mark and the thousands separator in
various countries that use the Arabic numeral system.`
`Style: 1,234,567.89 Countries: Malaysia, Mexico, New Zealand, Pakistan,
Philippines, Singapore, Taiwan, Thailand, United Kingdom, United States`
Closes#14402
In Sale settings, enable "Personalize the sales orders and invoice
report..." and also "Show line subtotals with taxes included (B2C)".
Print an invoice ==> traceback.
This is because the field `price_total` doesn't exist on an invoice
line. Note that this field exists on a SO line.
opw-694438
Previous implementation did not allow the user to search for pages 'name'
but only on the slugified name.
Now we slugify the needles before to find a match.
1. Create a new page: 'The new'
2. add a link on your website and try to find this page...
- Before this commit, the only ways was to type 'the-new'
- After this commit 'the new', 'The new', 'The-new', ... will match
This commit closes#10771
The location field is shown all the time. However it is only used for 2-steps
which is more complicated to configure and understand. That is why advanced
routings group is used to hide this field in other cases.
onchange_operation_type on repair line sets source and destinations locations
when changing the type. However the code does not handle multiple warehouses
in one company. Now the first found warehouse is taken into account and
code does not crash anymore.
Having 'Post Inventory' button highlighted makes it look like a necessary step
to take. However in practice using 'Mark As Done' is sufficient. Moreover this
action also posts the inventory.
Removing the oe_highlight makes it look like an optional step. It is still
necessary in some cases with SO / MO when not all products are produced.
- complete_name field should show the entire hierarchy of locations.
However currently it stops at first non view location. This commit
fixes the complete_name computation.
- name_get should correctly handle translations. It is now correctly
computed instead of relying on stored value which could be incorrect
depending on langages. Moreover name_get displays short name like
old implementation of complete_name.
Rev. 3f7d350fe21d9e2afb35a9ce3e2652940e3f259d1 introduced
auto-cancellation of the edit mode when the user clicks
outside the edited line.
The unfortunate downside was the auto-cancellation of the
edit mode also when the user presses ENTER while the
line is not valid.
This is especially annoying when using barcode scanners to
fill in values, as scanners usually send an ENTER keystroke
at the end of the input sequence.
When a many2one field is focused this event will often occur
before the autocompletion popup has a chance to open. At that
point the line is considered invalid, and the edition mode
is cancelled! If no field is considered dirty yet on the line
this simply drops the whole line, otherwise it will open a
navigation confirmation popup. Both results equally prevent
the use of barcode scanners.
This patch makes sure the edit mode is only cancelled when the
user indeed clicked outside the line, and not for other cases
where save() is requested, such as an ENTER keystroke.
The hw_scale module uses its own internal thread
for reading weights, independently of the polling
done by the POS screen.
The shortest internal reading interval is around
200ms, so polling every 50ms is useless.
150ms seems a good compromise in terms of perception
and resource use.
When we are trying to use the button 'set date to all order lines, we
get a traceback saying, that update cannot be done, because it ensure
that there's only one record. (After 9.0, there is no more this
'ensure_one').
This bug has been introduced in rev: https://github.com/odoo/odoo/commit/401a3cfaf6fd09f594e45c181e908900acba3777
To fix it, we iterate over the order lines, and do the update of each
line.
This commits fixes the following scenario:
1. load translations in language X
2. modify the source of a translated record (e.g. email template body)
3. click on 'load translations' button (flag)
4. execute the translation wizard for the same language (to refresh)
The translation of the modified record was duplicated.
This was due to the field src in the database being different than the msgid in
the po file. The src value is updated on the `insert_missing` call.
The matching on src for type='model' translations is only needed due to the
translations that are split (e.g. xml views or html content). For the other
translations, matching on the rec_id is enough.
opw-691752
Closes#14310
This commits fixes the following scenario:
1. load the translations for any language
2. modify the source of a translated record (e.g. email template body)
3. click on 'load translations' button (flag)
4. execute the translation wizard for the same language (to refresh)
The translation of the modified record was duplicated.
This was due to the field src in the database being different than the msgid in
the po file. The src value is updated on the insert_missing call.
The matching on src for type='model' translations is only needed due to the
translations that are split (e.g. xml views or html content). For the other
translations, matching on the rec_id is enough.
Detects the xml_translate and html_translate fields to avoid matching on src for
these translations.
opw-691752
Closes#14310
Revision a93ef48a70 stopped computing
the pseudo-fields for user groups when the user was not an admin.
This was a workaround to let portal users acces the preferences
menu without having read access to res.groups.
This fix is no longer necessary as the groups are now computed
in super-user mode. In addition, it creates an inconsistency
in the behavior of fields_get(). For instance there may be
cases where non-admin users are granted access to the regular
form view of res.users, and this would crash because the
view contains fields that would not be returned by `fields_get`.
The performance impact should also be negligible, given the
limited number of user groups in most databases.
-amount_currency in model account.analytic.line is a related field to move_id.amount_currency
where move_id is an account.move.line
-amount_currency is computed in function create on model account.move.line by considering that
amount = debit - credit (since 8.0)
-amount in model account.analytic.line is computed by considering that
amount = credit - debit (since 8.0) in the function _prepare_analytic_line.
So when creating a customer invoice with an analytic account in another currency, the created
analytic line has an amount which is the opposite of its currency_amount.
This commit also reverts the commit 7fca8ad89e to keep the same
behavior as in 8.0 for the creation of an analytic line from:
- an expense
- an invoice
- a task
The computed not stored field analytic_amount_currency displays the currency amount with the right sign.
opw:694085
Mass Mailing campain cannot use Mail Templates anymore (the user now
has to duplicate a previous Mass Mailing if he wants to start a new
one with a mail body which looks like the old one).
So this menu became useless and confused the users. Mail Templates are
a technical feature which is used by other module to send automatic
emails and these can be edited through debug mode in the Settings app.
Resolve#14148.
Without this patch, when a product was added to cart, if this addon
was installed, it always landed in English in the SO.
This happened because the context, containing the current language,
was being aborted here (`context=None` instead of `context=context`).
This commit closes#14340
When a picking is partially available, and the company works in 'just in
time', they often need to re-check the availability of some products
just before sending them.
In 8.0, it was totally possible, to recheck the availabilty of products.
To fix this, we just add a button when the picking state is 'partially
availbale', which does exactly the same as 'Reserve', but is secondary
and contains the label 'Recheck availability'.