Skip to content
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

[11.0][MIG] base_transaction_id #190

Closed
wants to merge 50 commits into from

Conversation

yvaucher
Copy link
Member

No description provided.

yvaucher and others added 30 commits November 16, 2017 16:28
(lp:c2c-financial-addons/6.1 rev 24.1.5)
…t working yet, just for backup)

(lp:c2c-financial-addons/6.1 rev 24.1.8)
…ll as on the automatic reconciliation wizard.

(lp:c2c-financial-addons/6.1 rev 24.1.10)
…eed both finaly

(lp:c2c-financial-addons/6.1 rev 24.1.15)
(lp:c2c-financial-addons/6.1 rev 58)
…ostly based on :

  account_statement_ext -> provide profile per bank statement, remove period, choose to use balance check or not,...
  account_statement_base_completion -> provide a completion rule system to fullfill the bank statement (partner, account,...)
  account_statement_base_import -> provide a base to create your own file parser for each bank/office and link it to a profile
  account_statement_transactionid_completion and account_statement_transactionid_import to use the transaction ID recorded in th SO
  account_advanced_reconcile -> An advanced way to setup reconciliation rules on every account
  account_financial_report_webkit -> some little fixes
(lp:c2c-financial-addons/6.1 rev 63)
(lp:c2c-financial-addons/6.1 rev 77)
…me account than the invoice's one (the payable / receivable)
@pedrobaeza pedrobaeza added this to the 11.0 milestone Nov 17, 2017
@pedrobaeza pedrobaeza mentioned this pull request Nov 17, 2017
26 tasks
* Joël Grand-Guillaume <joel.grandguillaume@camptocamp.com>
* Alexandre Fayolle <alexandre.fayolle@camptocamp.com>
* Guewen Baconnier <guewen.baconnier@camptocamp.com>
* Pedro Baeza <pedro.baezo@gmail.com>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is that email correct?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed it as he didn't contributed directly to that module, he has few commits through OCA module maintenance

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I haven't made anything significant here.

Bugs are tracked on `GitHub Issues
<https://github.com/OCA/bank-statement-reconcile/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smashing it by providing a detailed and welcomed feedback.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From latest README.rst template:
help us smash it by providing detailed and welcomed feedback.

@@ -0,0 +1,58 @@
# Translation of Odoo Server.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this file

'depends': [
'sale',
],
'website': 'https://www.odoo-community.org/',
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yvaucher remember to update this

# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{'name': 'Base transaction id for financial institutes',
'version': '11.0.1.0.0',
'author': "Camptocamp,Odoo Community Association (OCA)",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separate authors w/ space, please

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/OCA/maintainer-tools/blob/master/CONTRIBUTING.md#modules

According to contribution guidelines this is correct

author + ',Odoo Community Association (OCA)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Odoo parses both with or without spaces, so no problem in any

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pedrobaeza that just doesn't look good when it gets rendered, imho

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parsing is the same as said. You can try.

<?xml version="1.0" encoding="utf-8"?>
<odoo>

<record model="ir.ui.view" id="invoice_view_custom">
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

id must be declared before model

Copy link
Member Author

@yvaucher yvaucher Jan 18, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please give me a reference on this, according to the OCA codebase both are used:

└─> ack record.*model=.*id= --xml | wc -l
24252
└─> ack record.*id=.*model= --xml | wc -l
21737

EDIT: wrong greping
EDIT2: removing occurence of OpenUpgrade which is not revelent

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

===========

Bugs are tracked on `GitHub Issues
<https://github.com/OCA/bank-statement-reconcile/issues>`_. In case of trouble, please
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yvaucher
Copy link
Member Author

Thanks for the review, I did the fixes accordingly

Copy link

@simahawk simahawk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yvaucher code LGTM. Just some nitpicking non-blocking remarks

Base transaction id for financial institutes
============================================

Adds transaction id to invoice and sale models and views.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep ID always uppercase, just to make it homogeneous when referring to it

@@ -0,0 +1,20 @@
# Copyright 2012 Yannick Vaucher, Camptocamp SA

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2012-2018 ? Same for other headings

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

18615b1

Here are the changes I made, I don't think it deserve a bump on copyright as no code was change in python files.

@api.multi
def get_reconciliation_proposition(self, excluded_ids=None):
""" Look for transaction_ref to give them as proposition move line """
if self.name:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self.ensure_one() ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was written at a time we considered ensure_one to be called anyway. I can add it thought


@api.multi
def get_reconciliation_proposition(self, excluded_ids=None):
""" Look for transaction_ref to give them as proposition move line """

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a requirement but a good habit: no space around docstring text + end w/ period ;)

@api.model
def domain_move_lines_for_reconciliation(self, excluded_ids=None,
str=False):
""" Add transaction_ref in search of move lines"""

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docstring: same

<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_form"/>
<field name="arch" type="xml">
<xpath expr="//page[@name='other_info']/group/group/field[@name='origin']" position="after">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd replace group/group with // to make it more robust in case is moved. Even if as you are selecting the field origin.... why not selecting only that? Very likely we don't have the same filed twice. No?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, can obviously be simplified.

It was probably failing in v10 as it was changed from
<field name="origin" position="after"> to this.

If there are 1 origin field in the invoice lines before the origin field of the main object.

So it might be safer to stick with the expr but simplify it a bit.


@api.model
def domain_move_lines_for_reconciliation(self, excluded_ids=None,
str=False):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bad idea to use str as it is a builtin not sure were the super is defined though

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Defined in src/addons/account/models/account_move.py

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's try a PR on master odoo/odoo#22392

@yvaucher
Copy link
Member Author

Squashed commits

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM w/ some remarks

@api.multi
def get_reconciliation_proposition(self, excluded_ids=None):
"""Look for transaction_ref to give them as proposition move line."""
if self.name:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ensure_one?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would make it more explicit right.

)

@api.multi
def prepare_move_lines_for_reconciliation_widget(self,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to open the line right after the parenthesis :)

class AccountInvoice(models.Model):
_inherit = 'account.invoice'

transaction_id = fields.Char(string='Transaction ID',
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same remark about code formatting

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I also prefer this format with return after opening parethesis I prefer not to change this to not alter too much the code base history.

Copy link
Contributor

@grindtildeath grindtildeath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update website key in manifest, otherwise LGTM 👍

@yvaucher yvaucher force-pushed the 11-0-mig-base_transaction_id branch from bdfc16d to b6f25e6 Compare March 5, 2018 15:53
@yvaucher
Copy link
Member Author

yvaucher commented Mar 5, 2018

Changed website key in __manifest__.py and added an ensure_one.

Other demands seems irrelevant to me for that module migration.

@asaunier
Copy link

asaunier commented Apr 5, 2018

@yvaucher The PR has been approved and it seems there is nothing left to do with it. What about merging? :)

@yvaucher
Copy link
Member Author

yvaucher commented Apr 5, 2018

@OCA/accounting-maintainers anyone who could merge this?

As it is my PR I don't want to force merge.

@pedrobaeza
Copy link
Member

Can you maybe squash a bit the commit history? 🙏

Copy link

@asaunier asaunier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Squashing some commits would indeed help clarifying the history but I have the feeling this PR could be merged as is. @yvaucher already did some squashing 2.5 months ago. Isn't this PR been opened for too long now? :P

@pedrobaeza
Copy link
Member

Yeah, but 50 commits for such a simple module I think it's too much, but I let you the final call.

@yvaucher
Copy link
Member Author

yvaucher commented Apr 6, 2018

@pedrobaeza ok I'll squash few of my commits and drop the ones "Make modules uninstallable"

I guess I can easily make it around 40 commits, this is a quite old module thus we have many commits.

@yvaucher
Copy link
Member Author

yvaucher commented Apr 6, 2018

@pedrobaeza I squashed the commits in a new branch, thus I'm closing this one

#206

@yvaucher yvaucher closed this Apr 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet