Commit Graph
106 Commits
Author SHA1 Message Date
Lucas Perais (lpe) a21db141d4 [FIX] account: soften the constraint on company_id on partner's fp
Have a partner with company_id = False
Your user is currently in company A

Before this commit, only FPs with no company id could be set on the partner

After this commit, FP without company or belonging to company A are available

The drawback is that since this computation takes place in an onchange, when you first arrive on the partner
no filter is applied and you can choose whatever FP that appear
This might cause access errors when it is misued

related to #24256
closes #24507
2018-05-02 09:47:53 +02:00
Lucas Perais (lpe) 7b49f5836c [FIX] account: partner's fiscal position chosen within its company
Before this commit, a partner in a company could have a fiscal position belonging
to another company
Namely, the search view on the field property account position displayed every fiscal position

This could create problems afterwards, when managing an invoice from a restricted rights user
(with an access right error raising)

After this commit, we soflty constrain the choice of the fiscal position to the ones
belonging to the same company of the partner

OPW 1833848
OPW 1827831
closes #24056
2018-04-12 11:10:51 +02:00
Christophe Simonis 42264d8dcb [MERGE] forward port branch saas-16 up to 5d7ad2b16c 2017-11-30 18:43:08 +01:00
Christophe Simonis ab084d580f [MERGE] forward port branch saas-15 up to 98539336a5 2017-11-30 15:27:59 +01:00
Christophe Simonis 98539336a5 [MERGE] forward port branch saas-14 up to b780e4a0e4 2017-11-30 14:44:49 +01:00
Christophe Simonis b780e4a0e4 [MERGE] forward port branch 10.0 up to ba73fd534d 2017-11-30 14:13:39 +01:00
Florent de Labarre f7e80442d1 [FIX] account: Access error when opening a partner
If a user can read account.analytic.account but not the account.move.line,
when he tried to open a partner, there were an raise AccessDenied errors.

opw:782961
2017-11-28 13:12:43 +01:00
Christophe Simonis 1da064a1d3 [MERGE] forward port branch saas-16 up to 8ee9024a4c 2017-10-13 13:13:11 +02:00
Christophe Simonis aeae519a65 [MERGE] forward port branch saas-15 up to 945dd32eb0 2017-10-12 21:44:28 +02:00
Christophe Simonis 945dd32eb0 [MERGE] forward port branch saas-14 up to 91e2264b28 2017-10-12 18:43:14 +02:00
Christophe Simonis 91e2264b28 [MERGE] forward port branch 10.0 up to ba519bde84 2017-10-12 17:30:01 +02:00
Christophe Simonis ba519bde84 [MERGE] forward port branch 9.0 up to 40d4cdd39f 2017-10-12 16:23:17 +02:00
Carlos Dauden 40d4cdd39f [FIX] account: Field total_invoiced in res.partner doesn't include archived children 2017-10-12 13:20:57 +02:00
Nicolas Martinelli 99703583d4 [FIX] account: invoiced amount
- Create 2 companies: A is parent of B.
- Demo is in Company A
- Create 2 invoices for a partner: one in A, one in B (100 each)
- Validate the invoices

Connected as Demo, the 'Invoiced' amount on the partner form view (stat
button) is 100, while clicking on it shows both invoices (total of 200).

There is no need to manually add the company in the `where` clause since
the `_apply_ir_rules` will take care of adding the appropriate
multi-company rules.

opw-772479
2017-10-10 17:20:41 +02:00
Christophe Simonis 6c2ab192ea [MERGE] forward port branch saas-16 up to 88a9980b0c 2017-10-10 16:49:59 +02:00
Christophe Simonis 88a9980b0c [MERGE] forward port branch saas-15 up to 66945d3427 2017-10-10 14:15:24 +02:00
Christophe Simonis 66945d3427 [MERGE] forward port branch saas-14 up to 68d1ad5b7a 2017-10-10 13:27:29 +02:00
Christophe Simonis 68d1ad5b7a [MERGE] forward port branch 10.0 up to b1ce2dd6c1 2017-10-10 13:00:48 +02:00
Nicolas Martinelli b1ce2dd6c1 [FIX] account: invoiced amount
- Create 2 companies: A is parent of B.
- Demo is in Company A
- Create 2 invoices for a partner: one in A, one in B (100 each)
- Validate the invoices

Connected as Demo, the 'Invoiced' amount on the partner form view (stat
button) is 100, while clicking on it shows both invoices (total of 200).

There is no need to manually add the company in the `where` clause since
the `_apply_ir_rules` will take care of adding the appropriate
multi-company rules.

opw-772479
2017-10-10 12:33:27 +02:00
Christophe Simonis 1e17035f71 [MERGE] forward port branch saas-16 up to 268cf9d04a 2017-09-13 19:32:35 +02:00
Christophe Simonis 268cf9d04a [MERGE] forward port branch saas-15 up to 127dea7f66 2017-09-13 18:45:07 +02:00
Christophe Simonis 127dea7f66 [MERGE] forward port branch saas-14 up to 3d2a7a0d12 2017-09-13 18:21:23 +02:00
Christophe Simonis c8194a7647 [MERGE] forward port branch 10.0 up to c8b5c01340 2017-09-13 16:55:42 +02:00
Nicolas Martinelli 7f356d6653 [FIX] account: mark as reconciled
`last_time_entries_checked` is a commercial field, so bypassing the
write won't sync it.

Closes #19274
opw-770018
2017-09-12 18:27:33 +02:00
Nicolas Martinelli 39964e6cf2 [FIX] account: mark as reconciled
- Create 2 companies:
- Company A and check VIES VAT Check
- Company B and do not check VIES VAT Check
- Set current company of admin to Company A and do not allow Company B
- Create a demo user on Company B and give him Adviser group in
  Accounting.
- Log in with the demo user.
- Create a Customer A as a company with:
  Country = Spain
  TIN = ES85847955H
- Create a contact on Customer A: "Contact Sample"
- Create a Customer invoice on "Contact Sample" partner
- Through the menu Accounting/Payments, create a new payment on "Contact
  Sample" partner with the total amount of the invoice.
- Open the menu Manual Payments and invoicing matching. The invoice and
  the payment should be proposed for reconciliation. Do CTRL+ENTER.

An error message appears: 'The VAT number [ES85847955H] for partner
[Contact Sample] either failed the VIES VAT validation check or did not
respect the expected format ESA12345674.'

This message should not appear as the current user is on Company B which
doesn't have the flag "VIES VAT Check" checked.

The issue comes from the `sudo` in `mark_as_reconciled`, which will lead
to `self.env.user` to be the admin in the VAT check, and therefore
`self.env.user.company_id` will be Company A.

Closes #19274
opw-770018
2017-09-12 16:24:26 +02:00
Olivier Dony 695716efb0 [FIX] P3: remove pycompat.{keys,items,values} helpers
Now that we're closer to switching to P3 for good, these helpers have
outlived their usefulness, and mostly add noise.

All remaining dict.iter*() or dict.view*() must be converted to the
normal keys(), values() or items() calls.

Whenever the result is likely to be used for more than the scope of a
loop, or when the dict needs to be modified during iteration, the calls
must be wrapped in a ``list()``, to protect the new P3 semantics.
Those cases are very exceptional.

Also removed some dead code or improved the API to remove unnecessary
conversions.
2017-08-20 23:25:54 +02:00
Christophe Simonis bf51fe55a1 [MERGE] forward port branch saas-16 up to 0f2b2c4e2b 2017-07-07 14:30:30 +02:00
Christophe Simonis 0f2b2c4e2b [MERGE] forward port branch saas-15 up to 514a1a76d8 2017-07-07 14:18:07 +02:00
Christophe Simonis 5b28570769 [MERGE] forward port branch 10.0 up to aef7748845 2017-07-07 14:13:07 +02:00
Yannick Tivisse afefa1b771 [FIX] account: Display the correct records on 'Invoice' button
Currently it shows all the invoices, not the sales invoices that are paid or validated
2017-07-06 16:47:40 +02:00
Yannick Tivisse 1f277a3572 [FIX] account: Bring back the 'Invoice' stat button on partner form
It has accidentally disappeared in saas-15.
2017-07-06 16:17:23 +02:00
Olivier Dony b9e2207267 [MERGE] Forward-port 10.0 up to 7e44444878 2017-06-01 00:15:27 +02:00
Nicolas Lempereur 64d44527a8 [FIX] account: children in Invoiced partner button
When we are on a partner form view, we get the total invoiced containing
the child contact of the current partner. But when clicking the button
we only see the invoices of exactly the current partner.

In most locations of the code this has changed (since 347c784da) and
this part should also contain the descendants contacts.

opw-744929
closes #17188
2017-05-24 14:29:11 +02:00
xmo-odoo fffaf735f5 [FIX] P3: list -> iterable builtins (#16811)
In Python 3:

* various builtins and dict methods were changed to return
  view/iterable objects rather than lists
* and the separate Python 2 view/iterable builtins and methods were
  removed altogether

This is problematic when using these items as list (which the happens
repeatedly in Odoo), but more viciously when iterating *multiple times*
over them (which also happens, which I've messed up multiple times while
writing this, and which is a pain to debug even when you've just created
the issue).

Convert all code using these to semantics-matching cross-version
helper functions to get the LCD behaviour between P2 and P3, and
forbid the builtins via lint.

issue #8530
2017-05-10 09:39:55 +02:00
Christophe Simonis f265359187 [MERGE] forward port branch saas-14 up to bf23946e3d 2017-04-27 13:50:20 +02:00
Christophe Simonis 595b38fbdc [MERGE] forward port branch 10.0 up to 1faa4a74aa 2017-04-27 11:22:56 +02:00
Christophe Simonis ed0233fb8a [MERGE] forward port branch saas-11 up to 3d35aef5b0 2017-04-26 20:07:32 +02:00
Christophe Simonis 3d35aef5b0 [MERGE] forward port branch 9.0 up to 283b648c18 2017-04-26 19:46:46 +02:00
Nicolas Martinelli ec8699db17 [FIX] account: performance in issued total
When a partner has a lot of contacts, the computation of the issue total
takes a lot of time. Indeed, it performs the computation for the
partner, but also for all the children, despite the fact that the amount
is not displayed.

opw-726355
2017-04-24 13:27:02 +02:00
Fabien Pinckaers 525d094ef6 [IMP] account: misc UX improvements
Allow to configure the bank statement import mode from kanban
    When doing a manual journal entry, don't show the maturity date
    Removing Issued total, using credit instead (less code, more
    useful to have due amounts, instead of overdue)
    Creating a bank, set a name 'BofA Current' and an
    account number (that way, the account.account is based
    on name)
    Settings Wizard & menus: better sentences
    Statement CSV Import: installed by default (it
    does not add any menu)
    remove use_in_payment: complex field, only
    used for a default value
    Small code cleanup
[IMP] sale: moving order date to secondary tab (strange on a quotation)
2017-04-08 16:52:05 +02:00
Pratima Gupta 8c522750c8 [IMP] base: Rename res.partner _description from 'Partner' to 'Contact'
Purpose
=======

When using Studio and adding a many2one field for example, it will be easier for a non technical user to find the model res.partner under the name "Contacts" than under the name "Partners".
2017-03-06 10:46:45 +01:00
qdp-odoo ae22f61c22 [IMP] account: replaced 'xxx Invoiced' button on res.partner by an action.
This goes along the add of a 'partner ledger' button in enterprise, so we also removed the related actions
2017-02-27 15:55:15 +01:00
Christophe Simonis b3a1109372 [MERGE] forward port branch 10.0 up to c08a590bb1 2017-01-02 15:31:58 +01:00
Christophe Simonis 81f59cee2c [MERGE] forward port branch saas-11 up to b844d93889 2017-01-02 14:38:59 +01:00
Christophe Simonis b844d93889 [MERGE] forward port branch 9.0 up to 3805eb620a 2017-01-02 12:49:55 +01:00
qdp-odoo 4f29b77e3d [MERGE] foward port of 10.0 up to revision 84a650e33a 2016-12-30 17:21:25 +01:00
Christophe Simonis aa09c52205 [FIX] account: correct query
fix up of commit e98c329039.

opw:702908 opw:702909 opw:702910 opw:702911 opw:702918
2016-12-27 21:02:14 +01:00
Goffin Simon e98c329039 [FIX] account: where_clause in function _credit_debit_get
The where_clause needed a "AND" to work.
The where_clause didn't contain allias for "account_move_line" so when
injecting a condition with "account_move_line" it crashed.

opw:702538
2016-12-26 13:35:11 +01:00
Kinjal Mehta b0185e15cc [FIX] all: fix some common typos
Sale Order --> Sales Order
Sale Report --> Sales Report
Sale Team -> Sales Team
Payment Term --> Payment Terms
2016-12-22 13:29:38 +01:00
Alexis de Lattre 4fb380c107 [ADD] account: translate note on ka fiscal position
The 'note' field on account.fiscal.position is the "Legal mentions that have to
be printed on the invoices." As the invoice is translated in the customer
language, it makes sense to be able to translate this note too.

Closes #14735
2016-12-19 10:41:39 +01:00