With the pricelist, it is possible to define a pricelist just for
a variant. But in the product.product.form, only the pricelist items
linked to the product template could be displayed.
The field item_ids has been created in product.product model to display
all the pricelist applied on a product.
opw:674700
Let's take the following case:
- Enable lot tracking on a product
- Costing Method is "Real Price", Inventory Valuation is "Perpetual"
- Create a picking with 2 stock moves, each stock move is linked to the
same product
When the picking is validated, 4 account moves are created instead of 2.
This occurs because the list of stock moves and the list of reserved
quants is sent to the method `_move_quants_by_lot`, but there is no
check to which stock move is related a given quant.
For most cases, the issue doesn't show up since there isn't usually 2
stock moves with the same product in a given picking. There is at least
one use case where this happens: selling a pack of two identical
products. In this specific case, 2 stock moves of the same product are
created, but one pack operation will merge the 2 stock moves.
opw-680308
_('foo '+bar) does not work as `bar` is a variable with undefinied content
during translation export (and variable content during evaluation) so a match
will not be found.
Also trailing spaces are stripped during synchronisation with transifex.
The proper syntax would be
_.str.sprintf(_t("foo %s"), bar)
but to avoid breaking existing translations (need to reexport .pot)
use the syntax
_("foo ") + " " + bar
that is more stable friendly.
The 'No value found for the field...' string is not possible to be fixed without
breaking the translations should be split at least twice.
Write it the propre way directly.
These accounts are created automatically on the journals creation
e.g. On the creation of a Bank Journal, a Bank account is automatically
created, linked to this journal.
Before this revision, when installing the generic chart of account
(or l10n_us), you had two Bank accounts (101400, 101401),
and two Cash accounts (101500, 101501),
by default,
which is not right.
opw-676950
Search engines (or one at least) truncates the description at 160. The advised
size is between 150 and 160 so no need to force a smaller size. It's a good
idea to keep it at 155 but larger sizes should be allowed.
cf: https://moz.com/learn/seo/meta-description
We could fully remove the limit as there is corner cases where a longer size is
used (https://moz.com/blog/i-cant-drive-155-meta-descriptions-in-2015) but this
should be in addition with an indication for the user of the current size and
the advised size.
If the depreciation is not prorata temporis, the start date is defined
as:
- 1st of purchase month if frequency is < 12 month
- 1st of January instead
opw-681564
When a purchase requisition is created from a procurement, the
subsequent stock moves (create from the PO lines) are not linked to the
original procurement/stock moves.
This is an issue in the following use case:
- Product "Assembly" configured in MTO and manufactured
- Product "Part" configured in MTO and bought from suppliers thanks to
purchase requisitions
- A BoM is created for "Assembly" and is build from "Part"
When "Assembly" is sold, a MO is created, which generated a purchase
requisition for "Part". The MO is in state "Awaiting for Raw Materials"
since we need to purchase the components.
However, when the components are purchased and received, the MO stays in
the same state since there is not link between the stock move received
from the PO and the stock move created for the MO. The MO is therefore
stuck in "Awaiting for Raw Materials" state.
The fix is to keep track of the original procurement and stock moves.
Ideally, we should link the procurement to the PO lines, but that is not
possible since the field `purchase_line_id` on the procurement is a
Many2one. Therefore, we need to hook the confirmation process and
manually link the stock moves related to the PO to the stock moves
related to the MO.
opw-681138
This reverts commit f38f8930f0.
Revert for internal choice. Odoo want to use qweb in template and remove jinja support on next version.
If users want to use jinja they can change the view to use text widget instead of html widget.
Before this revision, it wasn't possible to invite new users
(in the Settings Dashboard) multiple times without reloading
the dashboard
e.g. Invite one user, then fill again the textarea, and click
again the `Invite` button
This is because a new widget is created at each reload,
because of:
```
load_invitations: function(data){
return new DashboardInvitations(this, data.users_info).replace(this.$('.o_web_settings_dashboard_invitations'));
},
```
and
```
reload:function(){
return this.parent.load(['invitations']);
},
```
and `this.$('#user_emails').val().` is empty at the second reload,
because the textarea retrieved with this selector is the textarea
of the previous widget, which is now empty.
It should probably be proper to make another mechanism for the reload,
that doesn't create a new widget each time,
but we don't take the chances in a stable release. Therefore,
we just use the event delegate target to retrieve the right
textarea.
opw-677680
When processing the delivery order coming from a sale order,
the delivery line must be created as sudo, as the user
processing the picking could not have the access rights
to create the extra line on the sale order
(e.g. for users being inventory users but not sales
users).
opw-677628
When an pos session is created, a bank statement is created and
it must be linked to the pos session.
A pos user doesn't have the rights to write and read on a bank statement.
This is why the creation of the pos session and the creation of bank statement
have to be done as super user.
opw:678970
When going to routes ['/my', '/my/home'], only the project issues in
portal privacy visibility must be displayed.
Inpired from 56c5d0a
The field privacy_visibility is not accessible in portal due to access
rights.
opw:676447
For `this.viewmanager.active_view` to be set, the view manager
switch mode must be completed, meaning the deferred returned by
the function `switch_mode` must be resolved
(see `this.active_view = view;` in `view_manager.js`, line 146)
In a 2many field, the view manager `switch_mode` deferred is resolved
when `is_loaded` of this field is as well resolved.
Before this revision, clicking fast on Save then Edit
of a vendor bills resulted to a JS error due to a race condition,
because `this.viewmanager.active_view` was undefined when
the field was not loaded / the view manager switch mode not completed.
opw-678097
The preview change the content because the browser try to fix the dom.
If a user use jinja and activate the preview, the jinja code is (re)moved by the browser and broke the template.
Some users using community version of Odoo may understand that this module turns
the POS into a certified module (which is what pos_blackbox_be does).
Update base.pot to reflect the changes (and add other missing translations)
The order of BOMs is based on the sequence which is
not present in the view. When you open all
BOMs, any order is defined. This patch will display the
list of BOM by product.
opw:681189
float_is_zero(value1-value2) is not equivalent to
float_compare(value1,value2) == 0, as the former will round after
computing the difference, while the latter will round before
opw:678588
When the mail composer is opened thanks to the "Send Mail" button in
Discuss, it's possible to save a mail template, but the user can't
access it anymore later on.
This is because the field `model` is by default empty in this specific
case since this is a client action. However, when saving the template,
the default value 'mail.template' is used for the `model` field.
Therefore the domain on the `template_id` field prevents the user to
find back the model he just saved.
The fix sends the `active_model` in the context with the value
'mail.message', so that the `default_get` method of
`mail.compose.message` will set the appropriate default value.
opw-677936
Rev e37ba61 forward-ported 8.0 revision f02b230 from PR #12379.
This patch introduces extra tests and views for o2m onchange behavior,
including new fields in the test models.
In 9.0 a new convert_to_onchange() mechanism had been
introduced at 9f81c6d
The combination of both requires some adaptation to the
expected results of the new tests and adaptation of existing tests.
The test models in `test_new_api` have an implicit depencies between
models which cannot be express on ORM:
messages depends on participants of their discussion.
So, when editing a discussion, the field `participants` should be
processed before field `messages`. This is not always done because
field processing order depends of the iteration order of a `dict` (which
is undefined in python).
The testing tour `widget_x2many` worked by chance until now.
Adapt the tour to save the participants before the messages.
Commit 358e285 introduces fiscal positions on the PoS. The new taxes
applied should be used in the form view of the pos order lines and in
the detailed sales report.
opw-680796
Setting NOT NULL constraints on required fields may fail if there are
any row with unset value for this column.
The ORM handle this case by catching the exception raised and warning
user.
However, not commiting the current transaction before, will rollback
changes made before like setting default values or renaming a column.
Some one2many fields have a domain specified
in their definition
e.g.
`mail.thread`.`message_follower_ids`
`hr.applicant`.`attachment_ids`
`project.task`.`attachment_ids`
which is required for the one2many field to make
sense. For the mail thread, it does not make sense
to include the followers of other models with the same
`res_id`.
This domain must be took into account when doing a
'like' search on the one2many field
e.g. Followers contains demo
Otherwise it will include threads from other model
opw-680825
When a product is a kit and a discount is applied thanks to a pricelist,
the discount is counted twice if the invoice is created from the stock
picking.
This is because the pricelist will modify the price unit, but moreover
the discount will be applied a second time by the method
`_compute_price` of the account move line.
opw-676838
Our usage of domain on fields One2many seems to trigger an obscure behaviour on
onchange.
With the following (simplified) config:
Message(models.Model):
_name = 'test_new_api.message'
important = fields.Boolean('Important')
Discussion(models.Model):
_name = 'test_new_api.discussion'
name = fields.Char('Name')
important_emails = fields.One2Many('test_new_api.emailmessage', 'discussion',
domain=[('important', '=', True)])
Email(models.Model):
_name = 'test_new_api.emailmessage'
_inherits = {'test_new_api.message': 'message'}
discussion = fields.Many2one('test_new_api.discussion', 'Discussion')
message = fields.Many2one('test_new_api.message', 'Message')
Steps:
- We change 'name' on discussion, triggers an `onchange()` call
- we ends up filling cache on virtual record (on secondary fields, we calling
record.mapped('important_emails.important'))
- we get a cache miss ('important' field not provided, only 'important_emails' ids,
i.e with no change on existing records)
- we fill the cache, this mark 'important' field as modified
- because of commit 5676d81 and because 'important' is that case is a related (i.e
computed) field we triggers cache recomputation
- as there is no way to recompute 'important_emails' for virtual record (no real
ID) we ends up with empty 'important_emails' generating removal of existing records.
=> Finally changing any value for 'test_new_api.discussion' that trigger an onchange
will always reset 'important_emails' to empty
Fixed by Raphael Collet <rco@odoo.com>, and test by Xavier Alt <xal@odoo.com>.
When user reset master password from web database manager, the
config file is saved.
If server was started in dev_mode the param dev_mode was saved
in openerp_serverrc silently. (in 9 or always in trunk)
Remind: --dev_mode should be never used on a production server.
Do not redefine the view arch but do a proper inherit.
It was a problem as the redefinition removed some fields (headers,..).
It was also a problem if crm_profiling was uninstalled as the redefinition was
not removed.
Closes#12454
New API use a frozendict for context, so when a function in the call
chain is overrided by new API (eg: render function of ir.qweb) the code
now changed by this commit would cause an error.
Instead this code duplicate the context frozendict as a dict removing
the need to set back the intial language in the context.
opw-681167
note: no need for >=saas-11
During refactoring of the field view, parent.model has been replaced by
model_id since it is more elegant. (odoo/odoo@4a60a3)
That was correct when you was working directly from the ir.model.field.
But if you was comming from ir.model -> fields -> 'add an item', the
model_id is unknow in the context of pyeval.
This commit close#12455
The group_lines method didn't make the sum of the quantity field, hence resulting in incorrect results when making product based statistics from the account.move.line records.
Courtesy of Luc De Meyer. Was PR #10551