PURPOSE
Try to move from onchange / default_get to stored editable computed fields.
Normally behavior should be the same (computed or set by user), with support
in create / write + onchange without additional code.
SPECIFICATIONS
Update classic fields with onchange to stored editable computed fields. It
means their value will come either from manual user input, either computed
based on triggers. Purpose is to remove all onchange and default_get when
possible.
Clean fields definition inconsistencies, like default / required on computed
fields. Indeed computed fields should always have a value, maybe coming from
user input. They should not have default / required that are attributes for
classic fields.
LINKS
Task ID 2088577
PR #41877
Enterprise PR odoo/enterprise#7278
Due to some default values / model strange computation a wrong model was
not considered as an invalid mailing. Let us fix tests so that models are
correct.
LINKS
Task ID 2088577
PR #41877
Enterprise PR odoo/enterprise#7278
The slide.slide and slide.channel "_compute_slides_statistics" methods do not
always assign a default value for the "total_slides" field.
This can cause some CacheMiss and seem related to nondeterministic errors on
the runbot.
Task#2123711
Runbot build error ID 247
closesodoo/odoo#41942
X-original-commit: c240d04ed0518897f76b315cd354ea6606aea645
Signed-off-by: awa-odoo <awa-odoo@users.noreply.github.com>
Without demo data, for the odoo-master transifex project
closesodoo/odoo#41935
X-original-commit: dab7670b73506fb3a835695ee3bd735e0c5e5c2b
Related: odoo/enterprise#7287
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Issue
- Export all english translation
- Import the file and override existing terms
Cause
When importing, we try to insert the translation if
it doesn't exists. If it exists, we do an update via
a "onconflict" rule.
This update can be done only one time but in the values to import
there are things like:
```
( 'Account', # translation
8, # numbers of duplicate
['account', 'account', 'account', 'account', # modules
'account', 'account_ponto', 'account_yodlee', 'payment']
)
```
Solution
It will not be fixed in stable to avoid performances issues.
Instead, we will display a clearer error message.
As it's a `psycopg2.ProgrammingError`, the cursor is aborted
and we can no longer use it to retrieve translations. This
is why I use a save point.
OPW-2150610
closesodoo/odoo#41934
X-original-commit: e108770d55b42a1793085a169145492b39d0a15c
Signed-off-by: Jason Van Malder <jvm-odoo@users.noreply.github.com>
- Create a product A, FIFO & Automated
- Create a SO, deliver and invoice
- Post the invoice
- Reset it to draft
- Post the invoice again
The COGS lines are duplicated.
Unlike the other lines, the COGS lines are only added at posting. This
is done in case several invoices are generated in draft, but validated
in an arbitrary order.
We clean up the COGS lines when resetting to draft.
opw-2153695
opw-2152465
closesodoo/odoo#41931
X-original-commit: 84cb3b9c848ed42017b3253ca70b9455c8af7307
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
The filename can be obtained in 3 ways when downloading a file, in order:
- by the filename argument
- by the filename_field argument
- a default one is computed as backup.
In the last case, there is by construction no file extension.
The filename is made from the record's model name, id and field.
However the model name almost certainly contains a ".",
which is the standard extension separator for filenames.
As a result <model_name_end-id-field> is considered to be the existing
extension, so we don't try to guess it from the mimetype.
To keep the existing default filename convention, we always add the
guessed extension in this case.
opw 2149612
closesodoo/odoo#41924
X-original-commit: f62a49a2f83bcce66eb9c3b08687ee5a37def503
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Slight semantics change on the behavior of _onchange_journal with
respect to payment_method_id: in the old version, it would be set to
the first method of the new journal if no default had been provided.
However if a default had been provided, a non-default method selected,
then the journal was changed, the method could remain to something
invalid. Instead, check if the method is still valid and if not reset
to either the default (if one was provided) or the journal's first.
It also seems like it'd make sense to update self.amount based on
self.invoices directly (instead of going back to the active_ids) but
TestAccountMovePayment does *not* like that.
Task 2115472
closesodoo/odoo#41868
Related: odoo/enterprise#7260
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
`possible_bank_partner_ids` is an override hook, it's not useful in
and of itself.
Task 2115472
closesodoo/odoo#41872
Related: odoo/enterprise#7261
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
When you are printing the sale details report in point_of_sale, there
are no payment method shown.
It is caused by the changing of model from statement lines to pos
payment.
So we ar now checking the pos payment instead of the statement lines.
ISSUE_ID: 41815
closesodoo/odoo#41867
X-original-commit: 2adce8b01cc19ae2bc0f3236d80d94b9725b32df
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Issue
- Install e-commerce
- Add stripe as payment acquirer
- Go in website > shop
- Add something in your cart and process checkout
- In developer tools > network set online to slow 3g
- Spam the pay now button
- Go in Website > Configuration > Ecommerce > Payment Transactions
Multiple transactions have been created for your order.
Cause
The pay now button doesn't stay disabled during the payment process.
Solution
Disable the button and enable it only when the process is done.
OPW-2148899
closesodoo/odoo#41910
X-original-commit: 76a0e4fea0d9a15b3d193e00dd473c4488d18640
Signed-off-by: Jason Van Malder <jvm-odoo@users.noreply.github.com>
Install POS, create a product available in POS, tracked by Serial
Number.
Add some units of product to the inventory.
Open the POS session, sell the demo item, close the session (do not end
the session, just close the interface).
Go to POS orders, select the last order and click on "Return Products",
the refund will be created with all the products
Edit the refund.
The user will be able to change fields of the refund such as price,
discount, quantity, etc but not the lot ids which will be fixed. Adding
the possibility to edit such field allow to aumatically manage inventory
on refund
opw-2152776
closesodoo/odoo#41905
X-original-commit: 7a02bdda12c161acb5b764866070b83872a7e566
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
On a Sale order having customer with bank information available create
an invoice (down payment).
Bank information will not be available.
This append because the company_id is not provided to the create and
bank information will not be available
https://github.com/odoo/odoo/blob/12.0/addons/account/models/account_invoice.py#L549
opw-2153810
closesodoo/odoo#41902
X-original-commit: 097db42b0302c769a6584004d7a9cbbc03856de7
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
It seems very strange that we'd want to use active_ids as invoices to
work with when when we already have invoices available, and these are
browsed / converted from the active_ids if they weren't provided
explicitly.
There's also an odd divergence between the filtering on the journal's
company here and in the default_get too: in the default_get we get a
journal in the user's company but then we only allow selecting a
journal from the invoices' company...
Task 2115472
closesodoo/odoo#41871
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
The dynamic domain really seems wholly unnecessary (though the static
one does require adding a field to a bunch of views)
Task 2115472
closesodoo/odoo#41870
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
On the website when you modified a string with not much change, we
modify the translation source so they are not dropped.
But we also do it for an en_US translation, so if we have a translation:
lang=en_US/src=helloworld/value=helloworld
if we change `helloworld` by `helloworld!` the translation would become:
lang=en_US/src=helloworld!/value=helloworld
which would make it seem like the change did not work at all.
Without change, modifed test fail on second:
self.assertEqual(view.with_env(env_us).arch_db, archf % terms_en)
with assertion:
AssertionError: '<form string="X">Bread and cheeze</form>'
!= '<form string="X">Bread and cheese</form>'
opw-2153422
closes#41714closesodoo/odoo#41809
X-original-commit: 7eb603b26cc591b85ceb11210f5db8308d2ba27a
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Now, instead of extending updateUI, developers can extend
_computeVisibility and _computeWidgetVisibility to indicate if the
whole option or a specific widget needs to be visible or not.
Without any JS, developers can also add a 'data-dependencies' attribute
on widgets whose value is a comma-separated list of widget names. Widget
names are specificied through 'data-name'.
Other notable changes:
1) *All* the options UI of a same section are updated on a change (not
only the widgets of the same option).
2) Back as it was before: the UI is only updated in non-preview mode
(prevent flickering of background removal during color preview
because of point 1).
Part of https://github.com/odoo/odoo/pull/41600closesodoo/odoo#41600
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
No more notion of 'can update UI' and a callback to filter the widget
which should be updated: the base case is that a widget is not updated
if being previewed and notion of "being previewed" is extended to
"having the focus or being opened".
Part of https://github.com/odoo/odoo/pull/41600
Since visitor banner has been added to the chat window (in discuss app),
the channel messages div has been pushed down (padding-top) to display visitor
banner without overlapping the channel content.
But this padding was always applied, even if there was no visitor banner
(in the case of normal -non live- chat). This commit only applies this padding
when the visitor banner is present.
Task ID: 2145749
closesodoo/odoo#41590
X-original-commit: 04f67217c4063d69477005a165b68b5ebecef01d
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
When a refund of pos order is made in the POS backend, the invoice was
created in draft, which is a different behavior than when an order is
created.
So we now automatically post the refund invoice once it is created, and
hide the button 'Payment', because if the invoice is reconciled with an
account payment, the session cannot be closed anymore as the invoice
should be reconciled with POS recievable.
We are also fixing a multi-company issue, because the validation of the
invoice was made in the company of the user, instead of the company of
the order.
closesodoo/odoo#41734
Issue-id: 2129357
X-original-commit: 1c0e5d1ad56802b23174809cdfd4b22914fc1ba5
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Pretty straightforward so long as you know `current_company_id` is the
currently active company for the user, which is exactly what we need.
Task 2115472
closesodoo/odoo#41869
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
This test will use a tax account and will possibly fail in case the
information is not loaded when test is executed
closesodoo/odoo#41884
X-original-commit: 9663bfe506fecf46200378e5934f9ba32b4497c1
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
- updateUI is async, most of the time it is really important to wait for
its async parts.
- method options are now async and should wait for async parts and user
choices before resolving their returned deferred.
While it was working perfectly in normal flows, some elements would not
have worked correctly if the datetimepicker was used another way. This
was revealed while working on another task.
This commit also fixes some issues:
- The datepicker was not working in languages where the date format is
different that the english one (the date was displayed correctly but
interpreted as if it was using the english formatting).
- Because of summernote, the datepicker sometimes loses the focus and
get it back directly... but this is enough for it to close. Now, we
open the datepicker on focus, not on click, so that summernote only
make it close then reopen right away (not possible to notice).
It's only for some use cases like paying a hotel or buying food
closesodoo/odoo#41888
X-original-commit: d076973fa48af000ead55019448de5261e2a766e
Signed-off-by: Josse Colpaert <jco@openerp.com>
We didn't apply the iotpatch files after upgrading the IoT Box,
resulting in the crash of the Box and the user needed to re-flash his
Box.
closesodoo/odoo#41885
X-original-commit: 8dceea9383ed94b9fed7e76bbbe33794526af417
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
Preivously, the code of the IoT Box was retrieved from the branch that
was used during the build but the drivers were retrieved from the
connected Odoo DB. Both could be in different versions, which forced
used to make old drivers compatible with the new Box or new drivers
compatible with old versions of the Box.
All of this made it quite hard to modify the existing code, even for
new versions of the Box in master.
When connecting the IoT Box to an Odoo DB, we now retrieve the version
of Odoo that is used and checkout the Box to this branch. This means
that we can now modify the code of the Box in master without having to
worry about users using the latest build with older DBs.
Taskid: 2120749
X-original-commit: 6af5d669593a4f431d14fce08c6151932f97da82
Since commit 4d23d241bf, there is only one
CoA left for China. No need to have 2 separate modules.
Also, the translation in english was broken.
closesodoo/odoo#41826
Signed-off-by: Josse Colpaert <jco@openerp.com>
Makes it way easier to realise that a cache access blew up because of
a @depends_context('active_ids'), which returns a list, which is not
hashable.
closesodoo/odoo#41863
X-original-commit: 5d2ce1fb3f2f14c9274924d3f4052279671a0c3b
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
- Set active = false on menu that has a parent
- Delete the parent menu.
It crashes in the unlink method of ir_ui_menu
because it didn't set parent=null on records that are inactive.
Because the search method to get children
of a menu item only returns node where active=true
if `active_test` is not passed in the context to
disable this active test filter.
closesodoo/odoo#41859
X-original-commit: a9c0c1d45583d547754735e857168d5ae27876a5
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
Purpose of this commit is to change or set prices automatically on
sale order line based on pricelist currency so removed depands from
currency field.
closes odoo/odoo#31535
Task: 2073790
Closes: #31535
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
purpose of this commit is when the pricelist is chnaged and
some products alredy added to the sale order, display a button
"recompute price" that throws a confirmation model asking for
recompute the price of the so line
task: 1947320
Closes: #31535
Co-authored-by: Mitali Patel <mpa@odoo.com>
Steps to reproduce
* connect as any user with right to edit website;
* go to website and chose a course;
* add content -> chose any of the possibilities;
* click on choose file, select a file and open it;
* click on choose file again, and then cancel
You get a traceback. This is due to the right panel that displays a preview
of the selected file. IN this commit we fix that issue by removing the
preview panel.
Task id 2146217
PR#40895
closesodoo/odoo#41837
X-original-commit: e59b86e6474ae994307952d53f4e5a7571ac1763
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Steps to reproduce:
-install point_of_sale
-open a session and make a few sales -> closes the session
-go to point of sale > reporting > sales detail
-select a specific start date and end date
=> the start and end date are ignored by the report
Previous behavior:
the start and end date option have no effect on the report
Current behavior:
the domain is taken into account when generating a report
opw-2149216
closesodoo/odoo#41834
X-original-commit: 157e3fe4d4fb47b33211d1e52116284090b3e01a
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
PURPOSE
Allow to use the text field with integrated emojis support in other apps
notably mass mailing
SPECIFICATIONS
This purpose is achieved in several steps, each done with different
commits to ease understanding
* move emojis mixin and FieldTextEmojis field definition from social to mail
application. Rename emojis namespace accordingly;
* allow emojis support in chat fields through new field widget;
* use this new widget in mass mailing subject field;
* perform some code cleaning;
See sub commits for more details.
LINKS
Task #2117238
PR #40045
Enterprise PR odoo/enterprise#6630
Related: odoo/enterprise#6630
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
PURPOSE
Allow to use the text field with integrated emojis support in other apps
notably mass mailing
SPECIFICATIONS
In this commit we somehow clean code related to emojis widgets
* simplify some code bits;
* update comments;
* add an option on the emojis widget to trigger ``onchange`` on a ``keydown``
event;
LINKS
Task #2117238
PR #40045
Enterprise PR odoo/enterprise#6630
PURPOSE
Allow to use the text field with integrated emojis support in other apps
notably mass mailing
SPECIFICATIONS
Now that we moved emojis widget from social to mail and allowed its use
within a char field, let us use it for email marketing mailings subject.
LINKS
Task #2117238
PR #40045
Enterprise PR odoo/enterprise#6630
PURPOSE
Allow to use the text field with integrated emojis support in other apps
notably mass mailing
SPECIFICATIONS
Currently there is one emojis enabled widget which is based on text widget.
It is therefore limited to ``<textarea/>``.
In this commit we propose to support emojis in char fields, aka using an
``<input/>``.
We therefore move most of the code within a ``FieldEmojiCommon`` and then
creates two widgets based on it
* ``text_emojis`` inherits from ``FieldText``
* ``char_emojis`` inherits from ``FieldChar``
LINKS
Task #2117238
PR #40045
Enterprise PR odoo/enterprise#6630
PURPOSE
Allow to use the text field with integrated emojis support in other apps
notably mass mailing
SPECIFICATIONS
Move emojis mixin and FieldTextEmojis field definition from social to mail
application. Rename emojis namespace accordingly.
LINKS
Task #2117238
PR #40045
Enterprise PR odoo/enterprise#6630
Install point_of_sale and a localization (i.e. l10n_be) with a tax
configured with 0% and no account.
Assign the tax to a product available on POS. Open POS session, sell
such product, close session and validate. Error message will popup,
blocking the action because the tax used for the product has no
associated account for posting the entry.
This should not be the case because the tax is 0% so it should not be
posted. Skipping taxes based on the amount to avoid the issue.
opw-2155173
closesodoo/odoo#41821
X-original-commit: c7936d2884c10865bfc39a43d30aef6926f29079
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
whenever we crop any image we set few data attributes to the cropped
image but if we change a cropped image from media dialog (ImageWidget)
we should remove crop related attributes from that newly added image
so that newly added image can be cropped with correct data.
since https://github.com/odoo/odoo/commit/a473453b3166a381130d9bd6ec4851b9e1ecab26
we are setting 'crop:originalSrc' data to the cropped image but not
removing from media dialog.
this commit also avoids unnecessary creation of an attachment.
closesodoo/odoo#41779
X-original-commit: 4a15b44243b3edbc7b2350806fea1a58f5734332
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Since the purchase_price is now computed, it may be triggered before an
uom is set on the product line (onchanges may happen after computes).
closesodoo/odoo#41808
X-original-commit: 9ebbdd24752a0ff1c1057fc533074555810ffa39
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>