132 Commits
Author SHA1 Message Date
Odoo Translation Bot b31ea21cab [I18N] Update translation terms from Transifex 2024-04-28 00:10:20 +02:00
Odoo Translation Bot 459412b860 [I18N] Update translation terms from Transifex 2024-04-21 00:08:43 +02:00
Odoo Translation Bot 3275156773 [I18N] Update translation terms from Transifex 2024-04-14 00:09:33 +02:00
Odoo Translation Bot a19537ea69 [I18N] Update translation terms from Transifex 2024-04-07 00:08:33 +02:00
Anita (anko) 5041bb16b8 [FIX] loyalty: Gift Card not usable if less that 1 point left.
If user had less than 1 point, which is equivalent to 1 quantity of set
currency, on gift card and eWallet, they could not use it due to not enough point on
Gift Card and eWallet for claiming reward.

opw-3667934

closes odoo/odoo#159984

X-original-commit: 64711a9152b6bb661392882d3403c194f5990fbc
Signed-off-by: anko-odoo <anko@odoo.com>
2024-04-03 07:19:48 +00:00
Alvaro FuentesandChristophe Simonis c18b9f44be [IMP] *: optimize multi-company rule
When we use the `|` (or) version of this rule the ORM generates two
sub-queries when checking the company. This causes sub-optimal and in
some cases really bad planning for the queries and thus PG takes hours
to complete them.

Example (formatted):
```sql
    SELECT "mrp_routing_workcenter".id
      FROM "mrp_routing_workcenter"
 LEFT JOIN "mrp_bom" AS "mrp_routing_workcenter__bom_id"
        ON "mrp_routing_workcenter"."bom_id" = "mrp_routing_workcenter__bom_id"."id"
     WHERE "mrp_routing_workcenter"."workcenter_id" in (1)
       AND (  ("mrp_routing_workcenter"."bom_id" in (
                    SELECT "mrp_bom".id
                      FROM "mrp_bom"
                     WHERE ("mrp_bom"."company_id" in (1))
                   )
              )
           OR ("mrp_routing_workcenter"."bom_id" in (
                    SELECT "mrp_bom".id
                      FROM "mrp_bom"
                     WHERE "mrp_bom"."company_id" IS NULL
                   )
              )
           )
  ORDER BY "mrp_routing_workcenter__bom_id"."sequence",
           "mrp_routing_workcenter__bom_id"."id",
           "mrp_routing_workcenter"."sequence",
           "mrp_routing_workcenter"."id"
```

If we use the single term version the generated query has only one
sub-query:
```sql
    SELECT "mrp_routing_workcenter".id
      FROM "mrp_routing_workcenter"
 LEFT JOIN "mrp_bom" AS "mrp_routing_workcenter__bom_id"
        ON "mrp_routing_workcenter"."bom_id" = "mrp_routing_workcenter__bom_id"."id"
     WHERE "mrp_routing_workcenter"."workcenter_id" in (1)
       AND (  ("mrp_routing_workcenter"."bom_id" in (
                    SELECT "mrp_bom".id
                      FROM "mrp_bom"
                     WHERE (("mrp_bom"."company_id" in (1))
                        OR  ("mrp_bom"."company_id" IS NULL))
                   )
              )
           )
  ORDER BY "mrp_routing_workcenter__bom_id"."sequence",
           "mrp_routing_workcenter__bom_id"."id",
           "mrp_routing_workcenter"."sequence",
           "mrp_routing_workcenter"."id"
```
In this version PG is able to produce a better query plan resulting in
better execution times.

Also, the `company_id` field is required on some models, so the "= False" comparison is useless.

closes odoo/odoo#159123

X-original-commit: 1b5c41f36801fb886ec591f29dba42787d698526
Related: odoo/enterprise#59378
Signed-off-by: Christophe Simonis (chs) <chs@odoo.com>
Co-authored-by: Christophe Simonis <chs@odoo.com>
2024-03-25 17:50:06 +00:00
Odoo Translation Bot 395140671f [I18N] Update translation terms from Transifex 2024-03-24 00:12:07 +01:00
Odoo Translation Bot c4bc200b47 [I18N] Update translation terms from Transifex 2024-03-17 00:11:43 +01:00
Odoo Translation Bot 1b9fd01d46 [I18N] Update translation terms from Transifex 2024-03-10 00:13:03 +01:00
Ethan Vincent a431b4ab58 [FIX] loyalty: access key with get vs subscript
Addendum to https://github.com/odoo/odoo/commit/7ed0a773b6e0

closes odoo/odoo#156161

X-original-commit: fb044fb5973449b0962066589f2a636c5665005a
Signed-off-by: Vincent Ethan <etvi@odoo.com>
2024-03-05 14:22:18 +00:00
Odoo Translation Bot cb45934163 [I18N] Update translation terms from Transifex 2024-03-03 00:09:56 +01:00
Levi Siuzdak (sile)andVictor Feyens 62081e5ec9 [FIX] {{website_,}sale_,}loyalty: format display points
Steps
-----
1. Create a loyalty card program awarding 1 point per $ spent;
2. make sure "Show points Unit" is enabled;
3. give yourself a loyalty card with 267.39 points on it;
4. create a product with a price of $0.89;
5. go to website and add it to your shopping car;
6. go to checkout.

Issue
-----
> You have 268.28000000000003 Loyalty point(s)

Cause
-----
The number comes from the `_get_real_points_for_coupon` method, which
uses `float_round` by way of `res.currency`.
The `float_round` function isn't suited for raw number display, as it
can make tiny rounding errors due to floating point arithmetic.

Solution
--------
Add a `_format_points` method to `loyalty.card` which will return a
string using the same format the `points_display` field uses.

opw-3705546

closes odoo/odoo#155652

X-original-commit: 767405a6fe8cea0407632acb57aae8bf25d8c001
Signed-off-by: Levi Siuzdak <sile@odoo.com>
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Co-authored-by: Victor Feyens <vfe@odoo.com>
2024-02-29 14:07:46 +00:00
Odoo Translation Bot 4f4ca50e8d [I18N] Update translation terms from Transifex 2024-02-25 00:13:04 +01:00
Ethan Vincent 52d7b2da2e [FIX] loyalty: prevent product id overwriting
**Current behavior:**
Creating a promo type loyalty program and editing the
'products' field in the 'Among' section of the rule created by
default at the bottom of the form view before saving the
program will cause the products selected in this field to be
cleared upon saving the program.

**Expected behavior:**
Filling out this field of the default rule before saving the
overarching loyalty program should result in the same behavior
as doing so after saving the program. That is, the field should
save the user's input.

**Steps to reproduce:**
1. Create a new loyalty program in the Discount & Loyalty tab

2. Give it a name and, before saving the program, edit the
     'Products' field of the default rule that is created at
     the bottom of the form to have at least one value

3. Now save the program and observe that the 'Products' field
     has been cleared of the previously selected values

**Cause of the issue:**
In the form view for the loyalty.program there are two
instances of the field trigger_product_ids which are set to be
invisible unless creating a specific program type. This field
is set to be related to rule_ids.product_ids in its definition
within the loyalty.program class definition. Thus, when the
user saves the program and rule concurrently, the empty
trigger_product_ids field overwrites the product_ids field
and whatever the user had populated it with is cleared.

The reason it only happens to the default rule and not ones
which are manually added before saving the program is because
in the traverse_related() method in fields.py, only the first
record of the related field is returned to be modified. In this
case, it means only the first rule's product_ids field is
overwritten.

**Fix:**
Overwrite the create() method in program.loyalty and check if
the program being created is of type 'gift_card' or 'ewallet'
then, if so, delete the trigger_product_ids key,val from the
dictionary so it will not later override the products specified
in the loyalty rule.

opw-3669953

closes odoo/odoo#155093

X-original-commit: 7ed0a773b6e0711b127f236ce665c35202d973bc
Signed-off-by: Vincent Ethan <etvi@odoo.com>
2024-02-23 10:46:09 +00:00
Odoo Translation Bot 1cf48deef9 [I18N] Update translation terms from Transifex 2024-02-18 00:12:23 +01:00
Paul Stroobant 9a9a44eec0 [FIX] loyalty: remove loyalty.card creation through contacts
Steps to reproduce issue:

1. Select a Contact
2. Click on Smart Button "Loyalty Cards"
3. Create a new Loyalty Coupon
4. Save
5. Receive an error:

>     The operation cannot be completed: another model requires the record being deleted. If possible, archive it instead.
>
>     Model: Loyalty Coupon (loyalty.card)
>     Constraint: loyalty_card_program_id_fkey

Explanation:

The model given to `program_id` by the `default` attribute is not always `loyalty.program`. In the case of the issue, for example, the model is `res.partner`.
https://github.com/odoo/odoo/blob/a3201d636505dc1976d3f0ee7f8cbf65d2488966/addons/loyalty/models/loyalty_card.py#L27

Suggested fix:

The creation of `loyalty.card` from `res.partner` Smart Button is not intended, therefore we will remove this option and set the Smart Button as invisible if `loyalty_card_count` is null.

opw-3707588

closes odoo/odoo#154258

X-original-commit: 8645874ec0e7ae81f032231be4908e173d2a4043
Signed-off-by: Stroobant Paul (stpa) <stpa@odoo.com>
2024-02-16 12:12:47 +00:00
Odoo Translation Bot dd40867949 [I18N] Update translation terms from Transifex 2024-02-11 00:14:17 +01:00
Tiffany Chang (tic) 94c58407f6 [I18N] *: add in Russian translations
For a first iteration, Russian translations were done using DeepL using
1 large .pot file of all the standard modules to translate (e.g. no
localizations, no test modules, etc). Unfortunately for some reason
doing a msgmerge with the existing ru.po files didn't seem to work, so
old "Translators" metadata at top of files were lost (maybe they will be
re-added during next Transifex sync?)

Part-of: odoo/odoo#152285
2024-02-06 18:49:02 +00:00
Odoo Translation Bot c95419af44 [I18N] Update translation terms from Transifex 2024-02-04 00:11:05 +01:00
Anita (anko) f2fb7c2026 [FIX] loyalty: fix logo scaling
Logo on pdf send to customer after generating coupon code was disorted if
it was not in certain ratio.

task-2588963

closes odoo/odoo#152245

X-original-commit: b1b94a075672067325ddcc125cbc57ae214b0a9a
Signed-off-by: anko-odoo <anko@odoo.com>
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2024-02-01 14:30:06 +00:00
Odoo Translation Bot 625dac5a10 [I18N] Update translation terms from Transifex 2024-01-28 00:16:34 +01:00
Mylyna Hy ec4d3f0a32 [FIX] loyalty: conditionally display expiration date
Problem: The test value for the expiration date was being shown on gift card reports that don't have expiration dates.

Purpose: The expiration date should only be shown if it's set for the gift card code.
It will be consistent with loyalty_report and the email template mail_template_gift_card in which both conditionally displays the expiration date.

Steps to Reproduce on Runbot:
1. Install Sales
2. Settings > Sales > Enable Discounts & loyalty programs
3. Navigate to Sales > Gift cards and create/generate a gift card code with no expiration date
4. Print the gift card report and the report will show the expiration date of 2023-12-31

opw-3686110

closes odoo/odoo#150954

Signed-off-by: Mylyna Hy (myhy) <myhy@odoo.com>
2024-01-25 16:59:01 +00:00
Odoo Translation Bot 95a4b6dfdc [I18N] Update translation terms from Transifex 2024-01-21 00:17:03 +01:00
Odoo Translation Bot b81790505b [I18N] Update translation terms from Transifex 2024-01-14 00:16:26 +01:00
Odoo Translation Bot 0e23020b84 [I18N] Update translation terms from Transifex 2024-01-07 00:23:19 +01:00
Odoo Translation Bot ad35458e8b [I18N] Update translation terms from Transifex 2023-12-31 00:18:24 +01:00
Odoo Translation Bot 50e8e08183 [I18N] Update translation terms from Transifex 2023-12-24 00:18:24 +01:00
Odoo Translation Bot 304a6caa14 [I18N] Update translation terms from Transifex 2023-12-17 00:08:26 +01:00
Odoo Translation Bot 8ab45d4a85 [I18N] Update translation terms from Transifex 2023-12-10 00:12:46 +01:00
Odoo Translation Bot 2ac98dc2e5 [I18N] Update translation terms from Transifex 2023-12-03 00:18:54 +01:00
Odoo Translation Bot 3ffba892de [I18N] Update translation terms from Transifex 2023-11-26 00:20:02 +01:00
Anita (anko) 54bbfea08a [FIX] (sale_)loyalty: fix gift card without any product
When there was no product in 'Gift Card Products' every
product was generating product equal to it's value.
Now when there is no product specified, no product will generate
gift card.
opw-3415384

closes odoo/odoo#143270

X-original-commit: 3d64ab7cc54a8bb69f98885fd037b2d48b1c2c29
Signed-off-by: anko-odoo <anko@odoo.com>
2023-11-23 08:52:06 +00:00
hungbui 4e7787b6f4 [FIX] loyalty: fix unable to open e-wallet program after archived
condition: install sale_loyalty only
"""
before commit:
right after archived e-wallet program, system will show python pop-up
error tuple index out of range
after commit:
able to open archived e-wallet program

closes odoo/odoo#143196

X-original-commit: 58a1c854b63a65e72b99b3466b3ef63a5e691e63
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-11-23 01:20:09 +00:00
Odoo Translation Bot f6fe982853 [I18N] Update translation terms from Transifex 2023-11-19 00:28:08 +01:00
Odoo Translation Bot 593ac17031 [I18N] Update translation terms from Transifex 2023-11-09 11:30:34 +01:00
Louis (wil) 68b4dfc2bb [I18N] *: import translations
closes odoo/odoo#141655

Related: odoo/enterprise#50484
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-11-08 20:48:14 +00:00
hungbui 8ed44d4767 [IMP] *loyalty: using free product display name
** before commit:
When create a free product reward, reward and sale order line
description use product's name so if many reward are variants of others,
the description will be the same. It make portal user confusing when
they chose reward in portal
**after commit:
the description will include display of product so that will contain
name of variants's attributes

closes odoo/odoo#141551

X-original-commit: 5619e8ce6b543c2b639860e8822f5d1bb4fcbeb0
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-11-08 13:34:05 +00:00
Odoo Translation Bot 5d2bc9e9b3 [I18N] Update translation terms from Transifex 2023-11-05 00:21:55 +01:00
Louis (wil) a46c800d53 [I18N] *: export source terms
closes odoo/odoo#140529

Related: odoo/enterprise#49925
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-10-31 15:54:32 +00:00
Odoo Translation Bot 6739c317d1 [I18N] Update translation terms from Transifex 2023-10-29 00:07:17 +02:00
Aditya DubeyandPrakash Prajapati <ppr@odoo.com>, Dheeraj Pandey <padh@odoo.com> c0d758d142 [IMP] loyalty: adapt to report layout
task-3447407

Part-of: odoo/odoo#135739
Co-authored-by: Prakash Prajapati <ppr@odoo.com>, Dheeraj Pandey <padh@odoo.com>
2023-10-27 14:21:54 +00:00
Louis (wil) 3f6f949fa5 [I18N] export sources
closes odoo/odoo#140002

Related: odoo/enterprise#49687
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-10-27 08:36:16 +00:00
Chrysanthe (chgo) df8535fbd4 [REF] portal, *: portal redesign
*: base, account, account_payment, auth_top_portal, hr_timesheet, loyalty,
   mrp_subcontracting, payment, project, purchase, sale, sale_stock,
   sale_timesheet, website_crm_partner_assign, website_sale,
   website_slides

Portal general redesign. Increase visual consistencies with the backend
[1] and adapt to the new default website design [2].

[1] https://github.com/odoo/odoo/pull/116641
[2] https://github.com/odoo/odoo/pull/120302

task-3046004

Part-of: odoo/odoo#138077
2023-10-25 15:50:36 +00:00
nikj-odoo bcd9f83eef [FIX] loyalty: invalid program field when specifying rules/rewards on new programs
Before this PR, users encountered an issue when attempting to add rules
to Discount and Loyalty programs. An undesired validation message would surface,
preventing them from saving their changes.

In this PR, the extraneous validation has been eliminated, enabling users to
successfully save and update their existing rules and rewards.

Task-3487478

closes odoo/odoo#134261

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-10-23 20:07:15 +00:00
Thomas Lefebvre (thle) 0728b447a6 [FIX] loyalty: default product for reward in multi company
Steps to reproduce:
-------------------
- being in a multi-company environment;
- have one product made that is first in alphabetical
    order of "Internal Reference" throughout the database (e.g. [AAA]);
- make this product specific to one of the companies
    (set the "Company" field on the product template)
- go into a different company within the database
    (not the one set on this product);
- create a new discount & loyalty record, and set
    the "Program Type" to "Discount Code".

Issue:
------
An access rights error occurs.

Cause:
------
When creating a `promo_code` program, we use the first product
that can be sold in the default reward values.

Solution:
---------
Take into account the company in the domain that retrieves
the default product.

opw-3538516

closes odoo/odoo#139008

X-original-commit: d80c28c78bf3237e2526a6370f9c6c0b0f8dc232
Signed-off-by: Thomas Lefebvre (thle) <thle@odoo.com>
2023-10-18 13:39:15 +00:00
Achraf (abz) a83bb76011 [FIX] loyalty: Prevent reward_ids to be reset to default
Steps:
    - Install `sale_management`
    - Go to `Discount & Loyalty`
    - Create a new one and set a name
    - Change default program type from `discount` to `buy x get y`
    - Remove the default rewards
    - Add a new one (the default one)
    - Click `Save & Close`
    - Trigger save

Rewards is reset to default `discount` instead of `buy x get y`

closes odoo/odoo#138523

X-original-commit: 798c69f44bfde2f66826775a5a11fe5e51adb9a8
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-10-12 17:20:44 +00:00
Pierre-Yves Dufays ed4f6d3dbe [MOV] web, mail: move filterable selection
We move the filterable widget from loyalty to web to make it more widely
accessible to other applications. It will soon be used in the new activities
plan feature.

Following the move of the filterable selection widget to the web module, we do
some light cleanup.

Task-3390865

Part-of: odoo/odoo#137969
2023-10-12 16:12:09 +00:00
Xavier Luyckx (xlu) bb963f1f7f [IMP] point_of_sale, *: improve demo data
*: loyalty, pos_loyalty, pos_restaurant, product

Part-of: odoo/odoo#137704
2023-10-10 15:42:52 +00:00
Jorge Pinna Puissant ef424a9dc2 [REF] *: remove owl from linter's accepted global variables
Before this commit, owl was in the linter's accepted global variables.
This allowed  direct access to owl global object.

For instance, to use xml from owl, you could do :
`const { xml } = owl;`
or you could use it directly:
`owl.xml`

Now, owl is not accepted on linter's global variables anymore, so to
import xml, now you need to use a proper import:

`import { xml } from "@odoo/owl";`

task-id 3498859

closes odoo/odoo#137517

Related: odoo/enterprise#48364
Related: odoo/design-themes#709
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-10-05 10:21:53 +00:00
luvi b91f4034ab [IMP] *: improve documentation of options in fields metadata
*: analytic,  base_automation, loyalty, mass_mailing, project, web, web_editor, website

This commit adds many new documentation of options and their usage for
fields. This makes them more usable and customizable in Studio, and adds
documentation for developers to know the type of expected option.

Some options that might lead to issues or that are too technical have
been removed, as they are not relevant and not required in most use cases.

task-3469741

closes odoo/odoo#134858

Related: odoo/enterprise#47148
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2023-09-27 14:57:03 +00:00