Models' write function has a return value which was not propagated when
overriding it for ir.ui.view in website_version module.
opw-658965
note: fix was already present in enterprise f0975cb
in `view_pivot.js`,
the method `view_loading` must wait the `self.fields` variable
to be defined before working properly.
This `self.fields` variable is filled in the `prepare_fields` method,
which is called in the `start` method, through a deferred named
`load_fields`.
`view_loading` is called in `start`, in `views.js`.
Therefore, in the overriden method `start` of `view_pivot.js`,
the call to `_super`, calling the `start` of `views.js`, must wait for
the `load_fields` deferred to be resolved.
Otherwise, the `self.fields` variable, mentioned above, won't be
filled in time.
opw-660153
If no timezone was defined for the user,
the timezone sent to Google for the events
syncrhonization was set as `False` instead
of the right default value `UTC`
opw-660171
Before this the only thing that would ever be printed was 'Guests: ',
because it was only added when receipt.customer_count evaluated to
false. Another issue is that receipt.customer_count doesn't exist in the
point_of_sale module. It is created by pos_restaurant, so there's where
it should be added to the receipt.
- The revision 950d66c086 brokes
the current inheritage. We replace it with a stronger inheritage.
- If the product is not published, the portal user cannot access
it on its product page `/shop/product/`, there is therefore
no need to set the link to this page.
opw-660191
This revision is related to 950d66c086
There is no need to browse the product as `sudo`, this is already
the case, as the template `website_portal.orders_followup` is rendered
with `order` browsed as `sudo` in the qweb context variables.
When a product is linked to several "supplier.info" records with
the same name or same product_name, the name or product must only
appear once.
opw:660107
1.In a SO, it's the line description that should be displayed rather
than the product name, for multiple reasons:
- The portal user may not have the right to see the variant attributes
values, and therefore the portal user would see which variant
he bought
- The description line can be customized by the salesman, adding,
extra information and so on
- The description line is within the customer language
2.If the product is not published on the website, the portal user
cannot see the product image, but the image should nevertheless
be displayed for his portal quotations. In addition, this is possible
to install `website_portal` without having installed
`website_sale`, and in such a case, the field `website_published`
is not even available on `product.product`.
opw-660191
By default, users can only create/edit/unlink
personal `ir.values`, the values with themself as
`user_id`.
Setting the default `deposit_product_id` should
therefore be done as sudo in case if the `deposit_product_id`
default value has already been created before by another user
but is no longer valid.
opw-660180
Timesheet lines are meant to have no product, and instead rely
on an implicit "Service" product. The UoM used is the company's
project UOM (project_time_mode_id), and the nominal cost of this
product is set on each employee.
Forcefully using the SO product as was done before is useless
and actually caused inconsistencies. The `unit_amount` value
would be expected in the UoM of the SO product, while still
being computed/set in the company's project UoM.
When no nominal cost can be found for an employee, the cost is
assumed to be 0, so the `amount` value is 0 too.
In addition, the product field is not supposed to be visible on
any form where timesheet lines are recorded.
This patch fixes various bits of logic related to this, including
parts which expected the `amount` value to be non-zero, or
the product to be set.
Zip range and state filtering were added at
377a6ecab0, but the
precedence between country, group, vat_required,
and not required were not correct.
This commit fixes the precedence as follows and adds
the corresponding tests:
0. Explict position on partner
1. Direct match on all criterions
2. Match on country+zip before country+state
3. Match on country before country group
4. Match on `vat_required` criterion on all
the above before trying them all again without
The function "product_uom_change" was built to reset the price unit
of a SO line when the uom was changed. Before this fix 503820a, the
price unit of the SO line only depended on the price list then it was
not needed to pass the fiscal position to this function.
After this fix 503820a, the price unit of a SO line also depends on
the taxes set on the SO line(e.g.:if an included tax is deleted, the
price unit must be recomputed without this tax). Then to recompute the
unit price, the function "product_id_change" must take into account
the fiscal position set on the SO to consider the right taxes to
recompute the unit price.
The fiscal position set on a SO must be passed to onchange_product_uom
each time it will be called because the price unit will be recomputed.
Was available before 3098ab7fd1.
This time, a special key in the context is required as this behaviour is quite slow.
(This commit could have been named "Dirty Hacking")
Because we now correctly format numbers, we have to parse the number
strings with web.parse_value(), then calculate the new amount and then
convert them back to a correctly formatted number string.
The number popup uses gui.numpad_input() which now only allows the
correct decimal separator (before this it was hardcoded as '.'). So we
now have to use the correct decimal separator in that particular popup.
Because of that we also have to correctly format the default tipping
amount AND also parse whatever value we get back from the popup through
web.parse_value().
Although you could do this formatting directly in the NumberPopupWidget
constructor, this would not be ideal because this widget is also used
for numbers that shouldn't adhere to the formatting (eg. PIN numbers).
In some places '.' was hardcoded as a decimal separator. Because now
payment amounts now get passed through web.parse_value() this causes
issues when the the decimal separator is not '.'.
opw-660024
Before this revision, the button "Pay now" on the quotation
in the frond-end was display only if the sale order
was in the state `manual` and that there was not
yet any payment transaction.
The thing is, since the release of 9.0,
the `manual`state no longer exists in `sale.order`,
and the pay now button was therefore never displayed.
From this revision, the condition to display the button
is based on the `invoice_status`, which need to be `to_invoice`,
meaning there is something to pay:
- The sale.order needs to be in states `sale` or `done`
- At least one line has to be invoiced:
- If the product has the `invoice_policy` set to `order`
- or if the product has the 'invoice_policy` set to `delivery`,
and at least one quantity has been delivered.
opw-659931
When using Anglo-Saxon accounting,
the customer invoice has two extra lines:
- One on the output account
- One on the expense account
the move line with the expense account should
have the analytic account set on the invoice line
This is related to the revision efee12a1bb,
solving the below issue:
https://bugs.launchpad.net/openobject-addons/+bug/921877
opw-659931
closes#10026
As the stat button "Quotes(s)" counts Quotations only (draft SO),
and the stat button "Orders" sum the total of Sales orders only (confirmed SO),
clicking on the buttons should open the SO list with the according filters
set.
Closes#9715
opw-660041
This revision is related to 5257721
`record._columns` doesn't contain all record fields,
computed non-stored fields are not included in `_columns`,
Therefore, when a computed non-stored field was used in the QWeb xml,
this crashed with a Keyerror exception.
Using `_fields` solves this issue. Nevertheless, translate
is not always set, but is set when the fields is indeed translatable,
so the use of `getattr` was required.
opw-660072
The initial problem is when generating a PO from SO (or the inverse) the taxes were not propagated to the new created line. Taxes are company dependent field : so when we create a PO in company A, the PO line contains the taxes of company A, but we want the corresponding SO line in company B to have the taxes of company B, which wasn't the case.
This commit makes the taxes propagation works. The initial line is now browse as sudo() to get all the taxes related to this line (or its product). Then we filter them to keep only the ones from the right company.
Do not forward port this commit, since the same patch will be applied in 9.0e
In 9.0 image_medium and image_thumb route are used to display thumbnail
of website_slides document.
These in 9.0 will scale the image, but also crop it so it has a good
aspect ratio.
In saas-6 this croping feature is not present and these thumbnail will
be scaled in diverse ugly way.
To improve a little the situation, this commit use some CSS (currently
not supported only by internet explorer) which give a similar aspect as
9.0's got.
opw-658957
According to the RFC1034
https://tools.ietf.org/html/rfc1034
A TLD can use up to 63 octets.
The regex checking that an email address is valid
should there allow emails using a TLD with such a length.
Besides, the use of TLD domains exceeding 6 characters is more
and more common, nowadays.
e.g. using a domain `.amsterdam`
opw-660014
Before this rev., no notification was sent on the bus when the user presence
changed. Thus, the bullets displayed in Discuss were never updated and stayed
as they were on the initialilization of the chat_manager (on webclient launch).
This rev. makes the bus.presence notifications work, and handles them client
side.
Moreover, the disconnections detection is now performed at each poll (with a
maximum of 1 per minute), instead of randomly (1/100 chance) at each poll, as
it scales better than the former solution. We also added a cron that performs
this check every 5 minutes. It is needed to detect that the last connected user
just disconnected (useful for visitors in the website, trying to talk with a
livechat operator).
Also, the 'away' status is now handled client side, as it makes more sense
that way (being away at each poll, e.g. every 50seconds, during 10 minutes
doesn't mean that we didn't come back between two polls).
Finaly, in bus.js, CrossTabBus, we moved the code writing in/reading the local
storage after the tab registration as this code depends on the fact that the
tab is the master tab or not (and this is known only once the tab is
registered).
This rev. was necessary in stable because the livechat uses the user status to
detect if there is an operator available, and this was often inaccurate.
Moreover, it improves the user experience of the chat in the backend.
The traceback ocurred when the operator closed a livechat channel chat window,
and then unpinned it from the sidebar in Discuss. Then, if the visitor sent
him a message, the channel was automatically re-pinned to the operator, who
received two notifications: the first one being the new channel info and the
second one the message itself.
The channel fold_state being 'closed', the window manager was trying to close
it again, which produces the traceback as the channel didn't exist in the JS
cache anymore (it was re-added to the cache when processing the message
notification, so just after).
Anyway, closing this channel was useless as, even if it was in the cache, it
would already been closed. So this rev. simply checks whether or not the
channel is in the cache before trying to close it.
The problem was that, when calling 'match_rules()' from the loader template,
we compared the wrong url with the url regexp defined in rules. Indeed, we used
the url of the page we were leaving, not the one we were going to.
We thus need to know if we are coming from the controller, or from the loader
template directly as the way to get the correct url differs.
Courtesy of JEM
- use channel configuration for the auto_popup
- clear auto_popup timeout when chat open to prevent opening the chat twice
if the user opens it himself before the end of the timeout
- don't send message when no feedback given