New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADD] account: add a line in reconciliation widget if we have a match… #27072

Closed
wants to merge 3 commits into
base: master
from

Conversation

Projects
None yet
4 participants
@csnauwaert
Contributor

csnauwaert commented Sep 18, 2018

…ing un-invoiced sale order

Task: 1879015

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

@C3POdoo C3POdoo added the RD label Sep 19, 2018

@csnauwaert csnauwaert force-pushed the odoo-dev:master-open-so-reconciliation-csn branch from 8c5bb67 to 1dd89c3 Oct 11, 2018

@robodoo robodoo removed the CI 🤖 label Oct 11, 2018

@csnauwaert csnauwaert force-pushed the odoo-dev:master-open-so-reconciliation-csn branch from 1dd89c3 to a5120a3 Oct 11, 2018

@robodoo robodoo added the CI 🤖 label Oct 11, 2018

@qdp-odoo

some remarks

if (line.sale_order_ids && line.sale_order_ids.length > 1) {
// Open tree view
this.do_action({
name: 'Sale Orders',

This comment has been minimized.

@qdp-odoo

qdp-odoo Oct 17, 2018

Contributor

_t('Sale Orders') ?

else if (line.sale_order_ids && line.sale_order_ids.length === 1) {
// Open form view
this.do_action({
name: 'Sale Order',

This comment has been minimized.

@qdp-odoo

qdp-odoo Oct 17, 2018

Contributor

_t ?

def _get_sales_order(self, st_line):
# Search if we can find a sale order line that match the statement reference
sols = self.env['sale.order.line'].search([('name', 'ilike', st_line.get('name'))])

This comment has been minimized.

@qdp-odoo

qdp-odoo Oct 17, 2018

Contributor

sols = self.env['sale.order.line'].search([('name', 'ilike', st_line.get('name')), ('invoice_status', '=', 'to invoice'), ('company_id', '=', some_company)])

and that's it.. what dayathink?

@csnauwaert csnauwaert force-pushed the odoo-dev:master-open-so-reconciliation-csn branch from a5120a3 to 02a3399 Nov 5, 2018

@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Nov 5, 2018

res = super(AccountReconciliation, self).get_bank_statement_line_data(st_line_ids=st_line_ids, excluded_ids=excluded_ids)
for line in res.get('lines', []):
line['sale_order_ids'] = self._get_sales_order(line['st_line'])
return res

This comment was marked as resolved.

@qdp-odoo

qdp-odoo Nov 16, 2018

Contributor

that's not efficient enough: make a search for all lines at once, in sql, with all your criteria applied (no second loop to keep only SO in 'draft', 'sent', 'sale' with no invoice_ids (btw this last part seems wrong))

<t t-jquery="caption" t-operation="append">
<t t-if="state.sale_order_ids &amp;&amp; state.sale_order_ids.length > 0">
<div class="alert alert-info">
There are <strong><a href="#" class="js_open_so">uninvoiced saled orders</a></strong> matching the communication of the bank statement line

This comment has been minimized.

@qdp-odoo

qdp-odoo Nov 16, 2018

Contributor

saled?
a saled orders?

I don't think so :-p

@csnauwaert csnauwaert force-pushed the odoo-dev:master-open-so-reconciliation-csn branch from 02a3399 to 490a965 Nov 23, 2018

@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Nov 23, 2018

@csnauwaert csnauwaert force-pushed the odoo-dev:master-open-so-reconciliation-csn branch from 490a965 to f100bf8 Dec 3, 2018

@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Dec 3, 2018

@qdp-odoo qdp-odoo force-pushed the odoo-dev:master-open-so-reconciliation-csn branch from f100bf8 to aa8ce30 Dec 5, 2018

@robodoo robodoo removed the CI 🤖 label Dec 5, 2018

@qdp-odoo

This comment has been minimized.

Contributor

qdp-odoo commented Dec 5, 2018

@robodoo r+ rebase-ff

@robodoo robodoo added the r+ 👌 label Dec 5, 2018

@qdp-odoo qdp-odoo force-pushed the odoo-dev:master-open-so-reconciliation-csn branch from aa8ce30 to 7b50e2b Dec 6, 2018

@robodoo robodoo removed the r+ 👌 label Dec 6, 2018

@qdp-odoo

This comment has been minimized.

Contributor

qdp-odoo commented Dec 6, 2018

@robodoo r+ rebase-ff

@robodoo robodoo added the r+ 👌 label Dec 6, 2018

csnauwaert and others added some commits Sep 18, 2018

[IMP] sale: notify matching SO in reconciliation widget
We now display a message informing the user that the statement line is matching a sent/to_invoice SO. The user can thus decide to follow the link and confirm the SO, create the invoice and come back on the reconciliation widget to reconcile the prepayment with the validated invoice (automatically detected).

Was task #1879015
[IMP] sale: invoice creation for downpayments cleanup
don't set the SO name in the reference/description field of the customer invoice, as it's already copied in the origin field
[REF] account: refactoring of the invoice validation
Better split of invoice_validate() and action_move_create() functions: the later now only deals with the account.move creation while the former assigns missing values (dates) and gets its number. The move now always receives its name from the invoice, which means there's no need anymore of the 'invoice' arg in account.move post() method.

We now also put the origin of the invoice in the move ref, in order to allow searching on that reference in the bank statement reconciliation widget.

@qdp-odoo qdp-odoo force-pushed the odoo-dev:master-open-so-reconciliation-csn branch from 7b50e2b to 6b98e43 Dec 6, 2018

@robodoo robodoo removed the r+ 👌 label Dec 6, 2018

@qdp-odoo

This comment has been minimized.

Contributor

qdp-odoo commented Dec 7, 2018

landed in master, for saas12.1, at revision a6d250a

@qdp-odoo qdp-odoo closed this Dec 7, 2018

@robodoo robodoo added the closed 💔 label Dec 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment