Before this commit, model that create ir_ui_view via _inheritS was ignored in --dev xml
The arch_fs was not set. Because it was not ir.ui.view, and because xml_id was suffixed by _ir_ui_view.
Now we manage the case of inherits. So if model model.name inherits ir_ui_view
class MyClass(models.Model):
_name = 'model.name'
_inherits = {'ir.ui.view': 'view_id'}
view_id = fields.Many2one('ir.ui.view', string='View', required=True, ondelete="cascade")
...
<record name='model.name' xmlid='pok'>
<field name='arch' type='xml'>content</field>
</record>
will be read from xml in dev mode.
parsing the xml file for xml_id pok_ir_ui_view and pok.
The orm by default will add this suffix.
The 'dynamic' view created when we update the groups is a special case, which we don't want the arch_fs
for dev mode because the xml only contains by default and an empty container and btw the imd was wrong
since we had the res.group model a xml_id into the _inverse_arch.
The page create via a template (method new_page) will automatically remove the arch_fs since we don't
want to see the empty container if we are in dev_mode.
When a pricelist was set on the public user that was different from that of the
website, the prices were displayed using the public user default currency,
but the currency symbol displayed was the website default currency.
The issue was that in the template, the currency was accessed as a computed,
related field of website while the price was obtained using a function call.
In the first case the field was obtained using sudo, and thus the call would not
get the public user pricelist.
opw-1817761
When a user returns a tracked product in the POS, it is not possible to
register the serial number. In case a customer returns 2 units of a
tracked product, the following error occurs:
'Cannot set the done quantity from this stock move...'
Since the serial number were not set, `qty_done` remains equal to zero
and `pack_lots` is empty. Therefore, we are trying to set a zero value,
which is actually useless.
opw-1817695
When changing the employee to None in an allocation,
this onchange raised an error because it attempted
to set an employee browser record (empty but still)
in a department many2one.
- Create a new leave allocation
- Try to change the field Mode (holiday_type) from "By Employee" to "By Employee Tag"
Fixes#23345
opw-1820069
When there were no status widget in the form view statusbar, the left
buttons appeared without any vertical space around them in a smaller
statusbar.
There also was a 1px mistake that made the buttons appear non-centered.
Now they appear centered in any case and a row of buttons is always
forcing the correct statusbar height.
Closes https://github.com/odoo/odoo/pull/22053
opw-(1)813479
The following bugs in detailed operations have been fixed in this
commit:
- Avoid to edit reserved quantity on move lines. When a picking is set
in 'UNLOCK' mode you are able to edit the reserved quantity of move
lines, even if it doesn't really causes problems it create confusion
on what is the reserved quantity.
- Avoid to edit the product_id on a move if there is a move lines linked
to it. This will cause inceonsistencies by having move lines with
product_id different than the related moves.
- Avoid to edit the product_id on a move line if it has a linked move for
the same reasons as above. We also avoid the edition when picking is
done to avoid issues with the stock valuation
- Remove call to 'force_assign' method on demo data as this method is
not used anymore and set some pickings in wierd states
- Adding a move line in the detailed operation view does not create an
associated move.
- Don't allow editing moves when we are in detailed views and state is
done, even if picking is unlocked.
TASK-1817931
Allow the user to set the quantity with barcode
scanning. This functionality was present in v9 but
didn't work in v11.
The code in order to make it work was already present in
_quantityListener however it makes a check on setQuantityWithKeypress
key on the obejct activeBarcode. Howver the key was never set during the
activeBarcode event.
This commit set the key on the activeBarcode if passed in the event data.
It also allow to trigger a barcode if the user is inside a modal.
Have the public user (not logged in -- user B) having a live chat with any logged in user (user A)
Having in mind that:
- (A) issues /history in his chatter to see where (B) has gone on the website
- The bus sends a kind of a "pull cookie request" on each clients
- The browser of (B) retrieves the cookie info and calls the relevant route
- That route sends the transient message for (A)
Before this commit:
The command did not work because the user of the route we end up on is the public one
hence, the search for the channel would not yield anything
After this commit:
The command does work as expected
OPW 1818732
closes#23485
Set up a delivery method that has a country set on it, but no states
(e.g. USA)
When the client is required to fill his address info in and when he chooses USA as the country
Before this commit:
The selection field where the states are selectable is not displayed.
After this commit:
All the states of the country are selectable
The usability choice is to say that if states are not specified on the delivery method
that means all states are supported
OPW 1818591
The python/xml try to create a default value for
property_stock_account_input_categ_id for all categories, but the yaml
only try for the All category and in 11.0 this is not propagated to
child categories.
This commit make the yaml coherent with account.chart.template
generate_properties and
stock_account.property_stock_account_input_categ_id XML record.
note: second part of 1bf25fc01
property_stock_account_input_categ_id,
property_stock_account_output_categ_id,
property_stock_valuation_account_id ir.property default values on
product.category could be duplicated eg. if l10n_generic_coa was
installed before stock_account.
This did not happen in enterprise but happened in enterprise breaking
the test added in odoo/odoo@6bcf9ac2e.
- Define 2 companies A and B. Delivery methods are linked to products in
company A
- Deactivate 'Share product to all companies'
- Create a user B in Company B only
- As user B, create a SO and open the drop-down list for delivery
methods
An access error is raised.
Delivery methods should follow the same record rules than the products
they are linked to.
opw-1815490
Issue:
An additional information page is part of our shop process to allow
additional information to be submitted. If this form is left blank,
then selecting the next button allows the process to continue.
However, if data is added to the form the form freezes and the process
will not continue when 'next' is selected.
Why:
Public user can not read the field 'model' of 'ir.model' (to save the
attachments)
opw-1818592
This is a manual forwardport of rev. b466b3bc.
Consider the following scenario: open in edit mode a form view
containing a many2many field displayed with widget many2many_tags,
on the many2many field dropdown, click on 'Search More' (it opens
a dialog), and in the dialog, try to save the current search in
the searchview's favorite menu.
Before this rev., it tried to retrieve the context of the active
controller in the closest instance of a ViewManager-like widget
in the SearchView's ancestors.
First, it is wrong as in the given scenario, the requested context
is actually the one of the list controller in the dialog, not the
one of the form controller in the background.
Second, it produces a crash in Studio, when trying to save filters
in the dialog opened by clicking on 'Search More' on the groups
many2many field in the sidebar.
This part of the code can't be tested in this version, but tests
will be added in master.
Fixes#23293
Consider the following scenario: open in edit mode a form view
containing a many2many field displayed with widget many2many_tags,
on the many2many field dropdown, click on 'Search More' (it opens
a dialog), and in the dialog, try to save the current search in
the searchview's favorite menu.
Before this rev., it tried to retrieve the context of the active
view in the closest instance of a ViewManager-like widget in the
SearchView's ancestors.
First, it is wrong as in the given scenario, the requested context
is actually the one of the list controller in the dialog, not the
one of the form controller in the background.
Second, it produces a crash in Studio, when trying to save filters
in the dialog opened by clicking on 'Search More' on the groups
many2many field in the sidebar.
This part of the code can't be tested in this version, but tests
will be added in master.
Fixes#23293
Have your OS be in Vancouver with time = 15:59:00
We are on day X
Have a next activity on a lead, scheduled for today
At 15:59:00 the next activity is not overdue
Before this commit:
Past 16:00:00 the next activity becomes overdue
This is because 16:00:00 is 00:00:00 in UTC (+8 hours)
And the next activity is scheduled for day X
But in UTC, we just passed at day X+1
Hence, the next activity being overdue
After this commit:
The next activity is not overdue, since we are actually on day X
OPW 1815323
The previous commit forbids to change the currency of a company having accounting entries, but there are some created by demo data and some tests were trying to set a different currency (to set up a fix environment). So in order to allow that in tests, we do it via a SQL query directly
Following the previous fixes in stock where we had to handle non-valued
move lines inside a valued move, the valuation of the dropshipping was
bypassed because a dropshipping move is not an in move, nor an out move.
We now value the dropshipping move always positively. We adapt the
sale_stock code that generate the anglo saxon entry to use the abs value
of the move, not -1 * value. It was done this way because all out moves
are negative.
We add 8 tests to test all the valuation cases: continental or anglo
saxon, ordered or delivered, fifo or standard.
opw-1817363
fixes#23214
Use case to reproduce:
- Create a sale order with a stockable product.
- Confirm the sale order.
- Validate the pick.
- Validate the pack.
- Cancel the OUT.
- Run the stock scheduler.
-> Picking are created from pick and ship.
The scheduler should not try to create missing pickings
for broken move's chain. Since v11, it's not possible to create
a partial mto chain that means if a chain is broken it's due to
a manual action from a user and thus we won't automatically
repair what he cancelled on purpose. That's why we won't create
a new move out in this case.
It also don't make sense to recreate a new mto chain from a
cancelled picking. Thus we had a condition in domain in order to
only take moves that make sense.
Based on preliminary work from Florent de Labarre <florent.mirieu@gmail.com>
Closes#23441#23458
OPW-1820226
This patch prevents bugs fixed at 5d463d2 to block the database.
It was preventing the autovacuum to properly clean old records.
Failing to unlink (may have various different reasons) should not block the
autovacuum to try on other models
Closes#23455
When creating a record in a form view of model A, and adding a line
in an inside tree view of model B(with a One2Many from A to B), it was impossible
to delete a wrong line even if the record has not been saved because the user had no
right to delete a record on model B.
opw:1819099
Since we are able to lazy load Qweb templates, there was
an issue to generate Awesome Timesheet iOS native app with
Cordova properly. It seems that under Cordova, iOS always
returns 0 for the status on a xml http request object.
The problem is that native applications are requesting
a local file from something that isn't a webserver.
The local file is delivered with no http headers that means no
"200 OK" header and no "404 Not Found" errors.
In this case, the request is still be completing as intended even
if the status code used by browsers is 0.
For more info, see:
https://developer.mozilla.org/fr/docs/Web/API/XMLHttpRequesthttps://bugzilla.mozilla.org/show_bug.cgi?id=331610
There is several issue happening when changing quantity:
1) if website_sale_stock is installed, the displayed price is not
updated when changing quantities.
2) if the "Add to Cart" price is not updated, it erroneously displays
the price multiplied by the quantity.
3) when prices are updated, it only update attribute_value_ids.
4) when variant are displayed as list view, visually the last list item
is selected instead of the first, also changing quantity doesn't
update price as it should be given pricelist.
The first issue is caused by invalid JSON in data-attribute_value_ids
attribute. The code modify the `.data('attribute_value_ids')` thinking
it will be permanent. But if the value was invalid JSON we always parse
it on the fly inside a temporary object so the object is never changed.
The second issue is because originally, the "data-attribute_value_ids"
inside "Add to Cart" was set wrongly (when rendering the view) because
get_attribute_value_ids got the website_price multiplied by quantity.
The third issue was even with website_sale_stock is not installed
`.data('attribute_value_ids')` was only updated for one of the possible
multiple ones in the page.
With this change, we had json.dumps to ensure data-attribute_value_ids
is good JSON, and we correct errors so it is fixed for instance only
updating sources without updating website_sale and website_sale_options
modules.
note: when views are updated, this also solves a bigger issue when
python2 is used (because attribute_value_ids contained u'text' strings.
another version will be merged in master with #23467
opw-1816479
closes#23392
If the user tried to generate a report with more than 256 columns,
he would get a traceback instead of an error message.
Furthermore, if only one measure was selected, then the check was not done
and the user would also get a traceback.
opw-1816931
This commit adds 3 indexes targeting project_task which are not only
useful in regular RW use cases, but help tremendously when deleting
tasks.
In a production scenario, deleting a single task record went from 685ms
to 5ms.
Equivalent queries for an existing database:
CREATE INDEX account_analytic_line_task_id_index ON account_analytic_line(task_id);
CREATE INDEX project_task_parent_id_index ON project_task(parent_id);
CREATE INDEX sale_order_line_task_id_index ON sale_order_line(task_id);
- Create an activity for a crm lead
- Set the lead as lost
The activity still appears in the list.
A proper fix would be to have an `active` field on `mail.activity`. In
the meantime, simply delete activites when archiving.
opw-1817703