66 Commits
Author SHA1 Message Date
Moises Lopez - https://www.vauxoo.com/ 3d3327d5f0 [IMP] point_of_sale: Speed-up queries filtering by 'pos_order.state'
The following method:
 - https://github.com/odoo/odoo/blob/2091994c/addons/pos_restaurant/models/pos_config.py#L40

Gets the following query:

    SELECT min("pos_order".id) AS id,
    count("pos_order".id) AS "table_id_count",
    "pos_order"."table_id" as "table_id"
    FROM "pos_order"
    LEFT JOIN "restaurant_table" AS "pos_order__table_id" ON (
        "pos_order"."table_id" = "pos_order__table_id"."id")
    WHERE (("pos_order"."state" = 'draft')
        AND ("pos_order"."table_id" in (TOO MANY IDS HERE)))  -- for this case 178 restaurant_table records ids
    GROUP BY  "pos_order"."table_id", "pos_order__table_id"."id"
    ORDER BY "pos_order__table_id"."id"

It spends 24ms without index

After creating index it spends 0.57

It is not the unique side filtering by pos_order.state column

Check the following lines of code:
 - https://github.com/odoo/odoo/blob/f5553c550/addons/point_of_sale/models/pos_order.py#L678
 - https://github.com/odoo/odoo/blob/f5553c550/addons/point_of_sale/models/pos_order.py#L690
 - https://github.com/odoo/odoo/blob/f5553c550/addons/website_sale_coupon/models/sale_order.py#L91

closes odoo/odoo#135636

X-original-commit: a658dfcd60032cfe01f2f019f4bf05e140d68339
Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
2023-09-15 18:13:47 +00:00
Moises Lopez - https://www.vauxoo.com/ f8bbec56f2 [REF] core: Improve the message for invalid manifest version
Considering the valid odoo version in the manifest version

The message before of this commit was:

    Modules should have a version in format ``x.y`` or ``x.y.z``

It looks like it enforces to removing the odoo version part as invalid

But it is not, in fact, it is already supported

It is important since OCA enforces ``{odoo.version}.x.y.z`` format

It was already discussed here:
 - https://github.com/odoo/odoo/pull/118420#issuecomment-1635047100

The message after this commit is:

    Modules should have a version in format `x.y`, `x.y.z`, `16.4.x.y` or `16.4.x.y.z`.

Notice the Odoo version "16.4" is the current {odoo.version} for the moment this commit was done

It avoid confusing about the valid formats to use

closes odoo/odoo#128810

Signed-off-by: Christophe Simonis (chs) <chs@odoo.com>
2023-07-18 19:28:11 +02:00
Moises Lopez - https://www.vauxoo.com/ d08043ea73 [FIX] requirements.txt: unpin pytz
On Debian based systems, the `tzdata` package is maintained to reflect changes
in timezones and there is no need to upgrade the `python3-tz` package.
On the other hand, for those who are using `pip` and thus our `requirements.txt`,
the package needs to be up to date. By unpinning it in the requirements.txt:

- new installations based on pip will be up to date
- older installations based on pip can easily upgrade
- debian based installations have to maintain the tzdata package
- mixed installs like on runbot will rely on Debian tzdata

closes odoo/odoo#117527

closes odoo/odoo#120155

closes odoo/odoo#120205

X-original-commit: bb0fe71388c04cf26884eba89d2e0d9d0c00a185
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2023-04-30 11:56:41 +02:00
Moises Lopez - https://www.vauxoo.com/ 088b9c2398 [REF] account_check_printing: Speed-up payment creation
The method constraint to validate the Check Number is slow

1. Analyzing the following query:

```sql
SELECT
    payment.check_number,
    move.journal_id
FROM
    account_payment payment
    JOIN account_move move ON move.id = payment.move_id
    JOIN account_journal journal ON journal.id = move.journal_id,
    account_payment other_payment
    JOIN account_move other_move ON other_move.id = other_payment.move_id
WHERE
    payment.check_number::integer = other_payment.check_number::integer
    AND move.journal_id = other_move.journal_id
    AND payment.id != other_payment.id
    AND payment.id IN (1085159)
    AND move.state = 'posted'
    AND other_move.state = 'posted';
```

The output is:

    Planning Time: 3.354 ms
    Execution Time: 2514.660 ms

Discarding null values

```diff
    AND other_move.state = 'posted';
+    AND payment.check_number IS NOT NULL
+    AND other_payment.check_number IS NOT NULL
```

The output is

    Planning Time: 3.216 ms
    Execution Time: 0.140 ms

2. The constraint is computed even if the payment is not a check (check_number is empty)

Returning early save useless extra computating
It is not needed to compare falsy values for duplicated for whole table

3. The validation to check is it not a number is not optimal

It is transforming the string -> integer -> string to check if the string is not a number
but it is enough using only string -> integer not needed to transform to string again

    python3 -m timeit -u msec -s "check_numbers = [str(i) for i in range(1000000)]" "[str(int(i)) for i in check_numbers]"
        > 1 loop, best of 5: 323 msec per loop

    python3 -m timeit -u msec -s "check_numbers = [str(i) for i in range(1000000)]" "[int(i) for i in check_numbers]"
        > 2 loops, best of 5: 135 msec per loop

It is better but not enough, using `str.isdigit` method is 5x faster than original approach

    python3 -m timeit -u msec -s "check_numbers = [str(i) for i in range(1000000)]" "[i.isdecimal() for i in check_numbers]"
        > 5 loops, best of 5: 64 msec per loop

closes odoo/odoo#83851

X-original-commit: 31e0ed8c957e8a6af7f6bd5d449b450967206eab
Signed-off-by: Olivier Colson <oco@odoo.com>
2022-02-03 09:03:13 +00:00
Moisés López f6c13d7c73 [REF] sql_db: Add odoo pid to connection in application_name
It helps to debug queries executed in postgresql from Odoo
in order to know where they were called

Enabling the postgresql logs with the following `log_line_prefix`

    log_line_prefix='%t [%p]: [%l-1] db=%d,user=%u,client=%h,app=%a '

You will see the following output in the postgresql.log:

    ... UTC [394452]: [371-1] db=odoo,user=odoo,client=127.0.0.1,app=odoo-740755 LOG:  00000: duration: 0.074 ms  statement: SELECT 1

Notice `app=odoo-740755` it is the odoo pid that executed the query
and the postgresql PID `... UTC [394452]:`

Then you will be able to match the odoo.log and postgresql.log using the PIDs

    740755 DEBUG odoo odoo.sql_db.connection: ConnectionPool(used=1/count=2/max=64) Create new connection backend PID 394452
    740755 INFO odoo odoo.addons: Running SELECT 1

Notice the Odoo PID `740755 INFO` and the postgresql PID `backend pid 394452`

Note: It will require enable the sub-logger
   - `--log-handler=odoo.sql_db.connection:DEBUG`

It will helps to debug what process is executing each query in the database
or if a postgressql PID is showing a error log related to connection (not even from a query)

e.g. The livechat stuck and you don't know what happen but you can see the postgresql.log the following message
for the same PostgreSQL backend_pid related to longpolling odoo pid

    [394452]: [371-2] db=odoo,user=odoo,client=127.0.0.1,app=odoo-740755 LOG:  XX00: Could not receive data from client: Connection time out

closes odoo/odoo#82857

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2022-01-20 07:25:41 +00:00
Moises Lopez - https://www.vauxoo.com/ ae7184eb21 [FIX] test_lint: Fix some false results
* [FIX] test_lint: Consider variables for sql-injection

Using the following code:

```python
var = 'SELECT name FROM account WHERE id IN {}'
values = (1, 2, 3)
self._cr.execute(var.format(values))
```

It has a risky sql injection ignored before of this change

And allow psycopg2.SQL way mapping the variables declaration

* [FIX] sql-injection: AttributeError: 'NoneType' object has no attribute 'parent'

Using the following code:

    queries = [
        "SELECT id FROM res_partner",
        "SELECT id FROM res_users",
    ]
    for query in queries:
        self.env.cr.execute(query)

The check sql-injection shows the following error:
 - AttributeError: 'NoneType' object has no attribute 'parent'

So, Now it is validating if it is not None

* [REF] sql-injection: Using better naming for node_ofc -> node_assign

* [FIX] sql-injection: Fix false positive using BinOp "+"

Considering the following valid case:

    cr.execute('SELECT ' + operator + ' FROM table' + 'WHERE')

The representation tree is:

    node.repr_tree()
    BinOp(
    op='+',
    left=BinOp(
        op='+',
        left=BinOp(
            op='+',
            left=Const(value='SELECT '),
            right=Name(name='operator')),
        right=Const(value=' FROM table')),
    right=Const(value='WHERE'))

Notice that left node is another BinOp node
So, it need to be considered recursively

closes odoo/odoo#77864

X-original-commit: ce1a0171f61d2808470c185a91e9f8299e4efd25
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2021-10-05 14:18:05 +00:00
Moisés López 9857b34fcc [FIX] base_import: mitigate concurrent update errors
Column mappings are updated in-place, if multiple users are importing records
of the same model at the same time, this will trigger concurrency errors.

This is made worse by the error only being reported on commit (after having
processed the entire import) and being retried automatically, so it slows down
the user and the entire system, the more concurrent imports the slower.

Log except:

    INFO dbname odoo.addons.base_import.models.base_import: done
    ERROR dbname odoo.sql_db: bad query: UPDATE "base_import_mapping" SET "field_name"='name',"write_uid"=%s,"write_date"=(now() at time zone 'UTC') WHERE id IN (%s)
    ERROR: could not serialize access due to concurrent update
    INFO dbname odoo.service.model: SERIALIZATION_FAILURE, retry 1/5 in 0.8720 sec...

closes odoo/odoo#57655

X-original-commit: 3f5e9ca625b53021c100245f5786bda4069974ad
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2020-09-14 13:40:19 +00:00
Moisés López 6c2cf31ff7 [REF] requirements.txt: Use gevent 1.5.0 version with fixes for >=py3.7.4
The following commit fixes >=py3.7.4 compatibility:
 - https://github.com/gevent/gevent/commit/9d27d269ed01a7e752966caa7a6f85d773780a1a
It was released in stable version gevent==1.5.0 on April 10, 2020:
 - https://pypi.org/project/gevent/1.5.0/

gevent==1.3.4 was released on June 20, 2018
 - https://github.com/gevent/gevent/releases/tag/1.3.4

And python3.7.0 was released June 27, 2018
 - https://www.python.org/downloads/release/python-370/

So, the current pinned version 1.3.4 is not optimized for py3.7

It could be a possible reason to reproduce the following error:
 - https://github.com/odoo/odoo/pull/50861

This change upgrades the pinned version to gevent==1.5.0
in order to get an optimized version for py3.7

Bump version to greenlet==0.4.14 for py3.7 since that it is the
version defined in the sha of release of gevent==1.5.0
 - https://github.com/gevent/gevent/commit/a1a72cb9
 - https://github.com/gevent/gevent/blob/a1a72cb9/setup.py#L188

closes odoo/odoo#57219

X-original-commit: bb0b32bd1a3fc0c047d0787b10e8c1c8d696daa5
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2020-09-07 18:04:02 +00:00
Moisés López e332320e64 [IMP] account_check_printing: speed up dashboard w/ index
Install "account_check_printing" module
Open "Accounting" icon from the main menu
It opens the journal dashboard by default

It runs the following search domain in account.payment model:
    domain = [
        ...
        ('payment_method_id.code', '=', 'check_printing'),
        ...
    ]

It runs the following query:
    SELECT "account_payment".id
    FROM "account_payment"
    WHERE ...
        AND  ("account_payment"."payment_method_id" in ($2)))
        ...

The average duration of this query is 37ms

It query is ran for each journal created
If you have created 600 journals (real case) so it will run 600 times
It will spend more than 22 seconds opening this dashboard
After that, you are available to create accounting actions since that
the menu is not available before of this dashboard
So, it is important to open it faster

Creating the following index:
    - account_payment(payment_method_id)

The average duration of the last query is reduced to 0.935ms instead.
It means, it will spend 0.5s opening this important dashboard with 600 journals

44x faster

closes odoo/odoo#56831

Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2020-09-01 23:41:42 +00:00
Moisés López 732fd98bbc [IMP] models.py: Method search_read propagate kwargs to read method
Currently the method `read` uses by default the parameter `load='classic_read')`
  - `self.read(fields, load='classic_read')`

So, it computes `name_get` for all m2o fields for all records in `self`.

If you want to avoid computing the `name_get` to save time and process
You can use an empty string in load parameter:
 - e.g. `self.read(..., load='')`

The method `self.search_read` call to `search` and `read` methods
but `search_read` method is not possible to assign `load=''` argument
(or other arguments of the method `read`)
 - e.g. `self.search_read(..., load='')`

So, you need to use 2 lines of code:
records = self.search(...)
records.read(..., load='')

This commit changes `search_read` method to receive all keyword arguments of the method `read`
So, you can use `self.search_read(..., load='')` and the `read` parameter will be propagated

closes odoo/odoo#46391

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2020-08-19 17:08:52 +00:00
Moisés López b6489f2763 [IMP] base_automation: Return early if there are not base.automation to process
Installing base_automation module the methods: create, write, unlink and compute_field
are patched.
So, they will be used  for all models.
It is important to save resources as possible.

The patched methods in base.automation read the original data
before to change so run all base.automation records.

But What about if there are not base.automation records?
So, we can save an extra read for all models

The same to pre-filter and post-filter
It adds a return early in order to skip this extra task when it will be useless.

closes odoo/odoo#52134

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2020-05-29 07:23:28 +00:00
Moisés López 10592f472c [IMP] base_automation: log time-based automated action starts and ends
If there is cron worker timeout logger error, there is a log for the
last cron running
If a "Base Action Rule: check and execute" fails, we need to know what
is the last base automated action based on-time running

This logger helps to looked for it

closes odoo/odoo#50493

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-05-11 06:03:54 +00:00
Moisés López a13bfacb0b [FIX] base: correct es_PE and es_CR locales
Change the decimal point and thousands separator for es_PE and es_CR
Set the currency symbol and position for Colon CRC

closes odoo/odoo#48535

X-original-commit: 88f420f37c305a7451be31ee36c479c2dffd4db8
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-03-27 16:31:36 +00:00
Moisés López b7752b7794 [FIX] phone_validation: Switch phonenumbers from logger.warning to logger.info
It was discussed previously from:
 - https://github.com/odoo/odoo/commit/b79d05fff0cacb4d99ebc1b60f44d8dab757b806

I quote Olivier Dony commit message:

"""
Having it in INFO should be sufficient for its purpose, and will avoid
impacting all CI builds done on a system that does not have the lib
installed.

For the record, this is not a hard requirement because the lib was not
available in Debian stable packages at the time of release. It is only
enabled on demand for those who want the feature and can install it
manually.

Fixes #22426
Closes #22459
"""

closes odoo/odoo#40788

X-original-commit: 0394f5e95702087b38357070aad43f2b477c374e
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2019-11-22 19:41:28 +00:00
Moisés López a5251e1d40 [ADD] test_lint: Add sql-injection pylint check
closes odoo/odoo#36583

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-10-02 14:16:38 +00:00
Moisés López 9819d20688 [REF] l10n_mx: Remove MX fiscal position after odoo/enterprise#5038
closes odoo/odoo#35505

Signed-off-by: Josse Colpaert <jco@openerp.com>
2019-08-06 15:26:33 +00:00
Moisés López 30a9120346 [FIX] l10n_mx: Set 'reconcile=True' for stock_account
Running the following 12.0 tests: https://github.com/odoo/enterprise/blob/b7768337d88990e403338c39e461ecb1796413ab/l10n_mx_edi_landing/tests/test_landing.py#L126
raise the following error using anglo-saxon:

```bash
File stock_account/models/account_invoice.py, line 60, in invoice_validate
File stock_account/models/account_invoice.py, line 89, in _anglo_saxon_reconcile_valuation
File 10n_mx_edi/models/account_move.py, line 12, in reconcile
File account/models/account_move.py, line 957, in reconcile
File account/models/account_move.py, line 948, in _check_reconcile_validity
odoo.exceptions.UserError: ('Account Mercancías en tránsito (115.05.01) does not allow reconciliation. First change the configuration of this account to allow it.', '')
```

closes odoo/odoo#34463

Signed-off-by: Josse Colpaert <jco@openerp.com>
2019-07-01 00:58:51 +00:00
Moisés López 72e7976d1e [FIX] account: Faster read_group for account_abstract_payment._compute_payment_amount
Go to Menu / Accounting / Vendors / Bills
Search a partner with too many opened invoices
 - E.g. 713 opened invoices (709 local currency, 4 foreign currency)
Choose all them
Press Open Action -> Register Payment
Wait to open the view.

Before this patch line_profile result

Total time: 1141 s
Line #   Hits  Time            Per Hit    % Time   Line Contents
================================================================
   243   2922   1,139,417,018.0  389944.2     99.9    amount_total = sum([MAP_INVOICE_TYPE_PAYMENT_SIGN[i.type] * i.residual_signed for i in payment_invoices])

After this patch line_profile result
Total time: 12 s
Line #   Hits  Time            Per Hit    % Time   Line Contents
================================================================
   243  2862   11,733,108.0        4099.6     98.1    invoice_datas = invoices.read_group([('id', 'in', invoices.ids)], ['currency_id', 'type', 'residual_signed'], ['currency_id', 'type'], lazy=False)

It means 95x faster

closes odoo/odoo#31313

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-03-08 06:53:18 +00:00
Moises Lopez 8f36b246d0 [I18N] clean es_MX old translations
Only keep the useful ones

closes odoo/odoo#28351
2018-11-02 09:38:23 +00:00
Moises Lopez a87d5a2b28 [ADD] sale: add menu to product categories
It was already present in the accounting and purchase application but not in
sale menus.
Apply the same logic as in purchase and use a group_no_one

Closes #22862
2018-09-14 14:06:27 +02:00
Moises Lopez e68350fcb5 [FIX] project: iterate on a single task
Do not retrieve the attachment of all records
Performance impromevement when iterating on a large number of records

From #26446
2018-08-30 13:33:52 +02:00
Moises Lopez - https://www.vauxoo.com/ 8bda4744b5 [FIX] requirements: improve python3.7 compatibility
Continuation from https://github.com/odoo/odoo/commit/27c017ad98b4c9ac5fdcd28c9fd84d3690993118
PyYAML was missed in the list
Closes #26587
2018-08-27 08:19:53 +02:00
Moises Lopez d790dfacb2 [ADD] sale: add menu to product categories
It was already present in the accounting and purchase application but not in
sale menus.
Apply the same logic as in purchase and use a group_no_one

Closes #22862
2018-08-16 09:59:01 +02:00
Moises Lopez ef110440dd [IMP] base: no private filters by default
The custom filters created through the search view are still private by default
but the ir.filters created manually (e.g. through xml files) are most of the
time global.
In odoo core addons, all ir.filters defined add the line

   <field name="user_id" eval="False"/>

This should simplify the development while not changing the behaviour for
actual users.

Closes #8218
2018-08-16 09:07:55 +02:00
Moises Lopez 27c017ad98 [FIX] requirements: improve python3.7 compatibility
Since af9d6b86a1 and
5a57c29ff2 , python3.7 can be used to run
Odoo. This commit ensures that python3.7 compatibles versions of gevent,
greenlet and lxml will be installed without breaking compatibility with
Debian Stretch packages versions when using the Debian packaged Python.

Closes #25841
2018-07-18 15:07:42 +02:00
Moisés López 276ea817f4 [IMP] db: force C collation for new databases
This makes sorting and indexing independent of the cluster/machine
configuration, and allows simple b-tree indexes to be used for
prefix-searches on VARCHAR columns without needing special operator
classes (and therefore without needing duplicate indexes).

The 'C' collation is built-in and always available on any postgresql
installation. It also allows any encoding/locale to be used, contrary to
other LC_COLLATE values, so it should never conflict with custom db
templates.

Admins who want to apply a special collation can still do so by creating
the database manually, instead of letting the system do it.

Closes #25196
2018-06-29 13:06:30 +02:00
Moisés López c2fec7ed88 [FIX] base_vat_autocomplete: add compatibility with python-stdnum>=1.9
The `country_codes` variable was replaced by `_country_codes` at
arthurdejong/python-stdnum@c113613b70

Make sure the syntax is the same

Closes #24395
2018-04-25 11:04:31 +02:00
Moises Lopez - https://www.vauxoo.com/ 354a1ee65e [FIX] doc: add missing text for calendar string field
Was missing the attribute

Closes #18278
2018-03-16 14:53:49 +01:00
Moises Lopez 85a3e1e385 [REF] *: deal with duplicated xml_ids in views and security rules
Was part of PR #19820. Courtesy of Vauxoo
2017-11-24 15:37:28 +01:00
Moises Lopez 593bb5e30d [REF] *: improved translatability of error messages
Was part of the PR #19820. Courtesy of Vauxoo
2017-11-24 15:35:27 +01:00
Moises Lopez - https://www.vauxoo.com/ eb90eb42ce [IMP] translate: export empty translations for empty ones
Instead of use the original string by default.

Currently odoo export a PO translation file using the logic:
"If there is not a translation then use the source."

This generate a false 100% of file translated for tools based on PO
files.

This commit change this logic to:
"If there is not a translation then use empty string."

Odoo import a PO translation file supporting empty string because
if a item is empty string odoo use the original source.

Closes #17925
2017-11-21 17:56:28 +01:00
Moises Lopez - https://www.vauxoo.com/ 534f91d496 [I18N] base_vat: VAT Translation for es_MX
Closes #20613
2017-11-02 15:26:45 +01:00
Moises Lopez - https://www.vauxoo.com/ 55188da4f4 [REF] tools check_with_xsd: Supports generic stream
In order to be able to use it either with a file or an bystream from an attachment. Was PR #19697
2017-09-29 17:24:39 +02:00
Moises Lopez - https://www.vauxoo.com/ 4e2db85f2e [FIX] base_address_extended: default to Null instead of empty string
for computed street fields.

Qweb reports delete the node if the value is Null but won't if the value is an empty string. And then, l10n_mx_edi module has errors because there are nodes with empty string and the minimum value is one char.

Courtesy of Vauxoo. Was PR #17169

Backport in Saas-14 from opw-770430
2017-09-08 10:13:30 +02:00
Moisés López 0819d3f116 [FIX] doc: Sphinx 1.2 support in html_domain
9a07a459 added "override=True" to silence a Sphinx warning in about
the address node already existing, however the override=True parameter
was added in Sphinx 1.4 (alongside the warning), so this breaks in
1.2.

Only pass in override=True if we're in 1.4 or later.

Closes #18232
2017-08-10 16:18:29 +02:00
Moises Lopez - https://www.vauxoo.com/ cdae67f03a [FIX] doc: remove 'report' dependency
This reverts commit bb7fef79a6.
Because now odoo merge report module into web one

Closes #18530
2017-08-04 15:39:24 +02:00
Moisés López c0bdf81a5b [FIX] doc: correct patch line number
to avoid "WARNING: Hunk"

Closes #18286
2017-07-18 11:14:47 +02:00
Moisés López 1dee64eda8 [FIX] doc: correct diff lines
to highlight the modified line

Closes #18230
2017-07-14 11:45:20 +02:00
Moisés López bb7fef79a6 [IMP] doc: Add 'report' dependency
To be able to correctly use report features.
It is auto-install but a good idea to make sure it is present and to show the
report module

Closes #18220
2017-07-14 10:55:30 +02:00
Moisés López ca82c77d48 [IMP] doc: remove <data> tag from xml files
Because now is no longer required

Closes #18144
2017-07-13 17:15:51 +02:00
Moisés López 566968bf99 [FIX] doc: use new URI wkhtmltopdf releases
The old release of wkhtmltopdf are no longer published on the download page.
The developer explicitely asks to use the github link

cf: wkhtmltopdf/wkhtmltopdf#3524
    wkhtmltopdf/wkhtmltopdf#3521
    wkhtmltopdf/wkhtmltopdf#3518
    wkhtmltopdf/wkhtmltopdf#3508

Closes #18146
2017-07-12 10:13:32 +02:00
Moisés López 4a3699bea9 [IMP] stock: add 'name_search' by barcode in stock.location
Closes #12043
2017-06-23 14:53:34 +02:00
Moises Lopez - https://www.vauxoo.com/ d7f84c273b [IMP] website_sale, website_portal: Re-use partner.check_vat method
Use check_vat function directly.
It already checks both format and centralize the dispatch of methods.

Closes #17644
2017-06-20 17:33:50 +02:00
Moises Lopez - https://www.vauxoo.com/ ce44ad2440 [FIX] base_address_extended: default to Null instead of empty string
for computed street fields.

Qweb reports delete the node if the value is Null but won't if the value is an empty string. And then, l10n_mx_edi module has errors because there are nodes with empty string and the minimum value is one char.

Courtesy of Vauxoo. Was PR #17169
2017-05-29 09:31:53 +02:00
Moisés López c132d4b33d [IMP] base_address_extended: Add new partner fields to company model
This module adds some extra fields to the partner model, in order to be able
to manage extended addresses. However, those extra fields were not present
into the company model, thus making partner's addresses and company's
addresses displaying somewhat inconsistent.

This change takes those fields that were already present into the partner
model, and adds corresponding fields into the company model and view, so
addresses from both models are now shown the same way.

Closes #16547
2017-04-24 11:44:35 +02:00
Moisés López 93bb6f322d [FIX] base: avoid variable referenced before assignment error
If the company currency is not active (that should not happen but nothing
prevents it, probably happening with some CoA installation), the variable
company_currency_format is undefined and an error is raised.

Closes #15799
2017-03-14 10:44:12 +01:00
Moisés López 9fc5a5ebfe [FIX] l10n_mx: Use valid label on invoices for taxes description 2017-02-01 09:40:29 +01:00
Moises Lopez - https://www.vauxoo.com/ c349e9a8f8 [FIX] stock: Add missing context to search
Closes #13636
2016-12-13 11:46:47 +01:00
Moises Lopez f507fc95c7 [IMP] fields: remove '_id(s)' from the label
For autogenerated labels.
Use title instead of capitalize to get every word with a capital letter.

Closes #12769
2016-12-07 10:47:04 +01:00
Moisés López 44a6366ba4 [REM] all: Remove es_MX.po files
- Previous information:
  - `es_MX` language is not published to [transifex](https://www.transifex.com/odoo/odoo-10/languages/) this is a official announce from thread [Regional languages and Spanish (Latin America) translations](https://www.odoo.com/es_ES/groups/community-translators-63/community-translators-20325962?mode=thread&date_begin=&date_end=) by @mart-e
  - Currently we have the files `es_MX.po` with terms translations outdated or wrong translation.
    - [Example wrong translation es_MX.po](https://github.com/odoo/odoo/blob/8de795291/addons/account/i18n/es_MX.po#L7788) should be [es.po correct translation](https://github.com/odoo/odoo/blob/8de795291/addons/account/i18n/es.po#L7975)
  - Now to change a `es_MX.po` a PR is required.
  - `es.po` terms translations and the most terms are fine for México too. (Not regional translation is required for most cases)

Then our regional translation process should be:

| step | If accepted | If not accepted |
|------|-----|-------|
|   Create a proposal to original language `es.po` from transifex    |   good and finish!  |   Create a new PR to odoo/odoo adding just that special term to `es_MX.PO` |

This PR reset the `es_MX.po` terms in order to fix many wrong terms using the good `es.po`.

Closes #14555
2016-12-05 09:11:13 +01:00
Moises Lopez - https://www.vauxoo.com/ 4fb15ccdd7 [RES] base: Add thousand separation for es_MX ","
More information from https://en.wikipedia.org/wiki/Decimal_mark section:
"examples of use"
`The following examples show the decimal mark and the thousands separator in
various countries that use the Arabic numeral system.`
`Style: 1,234,567.89    Countries: Malaysia, Mexico, New Zealand, Pakistan,
Philippines, Singapore, Taiwan, Thailand, United Kingdom, United States`

Closes #14402
2016-11-22 15:08:39 +01:00
Moisés López cc444338ed [FIX] base: change Mexican city name
'Distrito Federal' is renamed 'Ciudad de México'
English news:
https://www.theguardian.com/world/2016/jan/29/mexico-city-name-change-federal-district-df
Official reference (spanish):
http://www.dof.gob.mx/nota_detalle.php?codigo=5424565&fecha=05/02/2016

Closes #14034
2016-11-08 15:37:46 +01:00
Moises Lopez 6665a6a6e1 [IMP] base: add search on 'vat' field in name_search() of res.partner.
Courtesy of Vauxoo
2016-11-07 11:06:51 +01:00
Moisés López dc18056fd0 [IMP] tools: support known "falsy" string values for XML boolean fields
Historically, developers had to use the `eval` attribute to set
a False value for boolean fields in XML data files:

    <field name="active" eval="False"/>

This is a source of errors for beginners, who tend to provide
a string value directly, as for char/text fields.
Unfortunately string values always evaluated to `True` booleans:

    <field name="active">False</field> <!-- active == true! -->

This patch adds detection of some well-known falsy strings
(case-insensitive): `0`, `false`, `off`, as similarly supported
for the `noupdate` and `forcecreate` attributes of XML data records.

Closes #13152
2016-09-02 13:25:27 +02:00
moylop260 6b56091749 [IMP] hr_payroll_account: more generic partner computation
Add method to get partner from hr_payslip_line instead of forcing the current rule
Fixes #3385
2015-06-16 23:28:28 +02:00
Moises Lopez a0f44726b1 [CLA] add missing vauxoo people 2015-06-12 09:39:51 +02:00
moylop260 820d6aa760 [FIX] purchase: avoid duplicated product codes in demo/test data
Closes #5414
2015-04-07 10:17:16 +02:00
Moises Lopez - https://www.vauxoo.com/ 80c2ee2e6c [IMP] stock: Add limit=1 in search of _picking_assign 2015-02-23 10:44:04 +05:30
moylop260 88ab3db5f2 [FIX] product: missing default init before using it as dict
This revision bring back the possibility to use the copy method
of product.product without passing parameters

Closes #5236
2015-02-13 15:03:13 +01:00
moylop260 f2ab162d31 [FIX] l10n_mx: Set reconcile=True on receivable and payable accounts
This is necessary to enable reconciliations on these
accounts, and also ensures the residual amount on
invoices will be properly computed.

Closes #5235
2015-02-12 15:08:08 +01:00
moylop260 9ec5529ac1 [FIX] product: avoid duplicate product ref in demo data
Closes #5142
2015-02-11 10:14:35 +01:00
moylop260 028458a87f [CLA] vauxoo
Closes #5178
2015-02-09 22:15:30 +01:00
moylop260 8351c6c5ed [IMP] Use explicitly relative imports in backend doc
closes #3336

Implicit relative imports have been removed in Python 3, and developers
should be encouraged to use explicitly relative imports to avoid
confusion between local and global modules

See https://www.python.org/dev/peps/pep-0328 for PEP on the subject with
reasonings and justifications
2015-01-15 15:36:37 +01:00
Moises Lopez 9f33f77f3e [REF][hr_timesheet_invoice] Add if exists domain and pep8 in modify lines.
bzr revid: moylop260@vauxoo.com-20130908212817-sxx8n2iaqoqpwpgj
2013-09-08 14:28:17 -07:00
Moises Lopez e37f1e0f26 [FIX][account_payment/test/payment_order_process.yml] Fix test/test_hr_timesheet_invoice.yml too
bzr revid: moylop260@vauxoo.com-20130908205724-uylcetl1e4xy908t
2013-09-08 13:57:24 -07:00
Moises Lopez 50492bb349 [FIX][hr_timesheet_invoice] Fix global->particular invoice search to test_hr_timesheet_invoice_no_prod_tax
bzr revid: moylop260@vauxoo.com-20130907161501-9uip7h4simwv8ccz
2013-09-07 09:15:01 -07:00