-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
[14.0][ADD] account_wallet - NOBUMP #9
base: 14.0
Are you sure you want to change the base?
Conversation
As sequence should be set instead of fixed name, don't create move with a name
Only limit cases where partner_id AND account_id are filled in
change button_box
the existing mechanism did not work 2 new methods implemented/overriden
c9aa785
to
b49885a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@legalsylvain Thanks for this.
@xavier-bouquiaux @Cedric-Pigeon I made comments that could break our tests but IMHO, @legalsylvain work is great.
account_wallet/tests/common.py
Outdated
cls.partner = cls.env.ref("base.res_partner_2") | ||
|
||
def _provision_wallet(self, amount, wallet=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@legalsylvain I'm not in favor of this in this version as other tests depends on.
@@ -1,7 +1,7 @@ | |||
<?xml version="1.0" encoding="utf-8" ?> | |||
<odoo> | |||
<data> | |||
<record id="wallet" model="account.account"> | |||
<record id="wallet_account" model="account.account"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't change this neither.
account_wallet/tests/common.py
Outdated
@@ -23,43 +23,87 @@ class WalletCommon(common.SavepointCase): | |||
def setUpClass(cls): | |||
super(WalletCommon, cls).setUpClass() | |||
load_file(cls.cr, "account_wallet", "tests/data/", "account_wallet_data.xml") | |||
cls.wallet_obj = cls.env["account.wallet"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is not necessary (in this version)
Hi. @rousseldenis. Thanks for your partial review. I'll ping you when it's ready to review. I hope at the end of this week. Regarding refactor, This PR includes breaking changes regarding your previous PR(s). Some adaptation should be done but I prefer to refactor correctly the module before the introduction into the OCA because the refactor introduce some simplification.
Also, it is fixing some things. for exemple, regarding the xml_id, "wallet", the name is wrong, because it's not a As said before, if you have time, I'm available to talk with you regarding the refactors. kind regards. |
…account_move_line_ids) are in the state 'posted'
6b8c6d7 should fix the major problem of bad balance computation on draft / canceled move lines mentionned here #2 (comment) provide also simplification.
|
…_nominative_creation' for better comprehension
…lines (account_move_line_ids) are in the state 'posted'
…nt wallet without partner defined
eca8ccc
to
237427b
Compare
237427b
to
223e7ef
Compare
…any and or multi wallet type context
Hi @rousseldenis : correction and improvement work almost finished. Could you review ? I have a question left, regarding the moves generated by the credit note wizard. I don't understand why the move lands in the sale journal, and not in a miscellaneous journal. Advantage to not use sale journal :
|
@xavier-bouquiaux Could you review ? |
do not take my approval into account -> still reviewing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First round of review
* Laetitia Gangloff <[email protected]> | ||
* Cedric Pigeon <[email protected]> | ||
* Denis Roussel <[email protected]> | ||
* Xavier Bouquiaux <[email protected]> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@legalsylvain
add yourself here at the very least
|
||
@api.depends(lambda self: self._get_compute_balance_fields()) | ||
def _compute_balance(self): | ||
for wallet in self: | ||
balance = 0 | ||
for move_line in wallet.account_move_line_ids: | ||
for move_line in wallet.account_move_line_ids.filtered( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is a HUGE change
i'll have to test
@@ -15,3 +15,7 @@ class AccountMove(models.Model): | |||
help="Use this field to give coupon to a customer", | |||
states={"draft": [("readonly", False)]}, | |||
) | |||
|
|||
def action_post(self): | |||
self.mapped("line_ids").create_or_set_wallet() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is linked to the other but it's also a MAJOR change
<field name="inherit_id" ref="account.view_account_payment_register_form" /> | ||
<field name="arch" type="xml"> | ||
<field name="journal_id" position="after"> | ||
<field name="account_wallet_id" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't you put some kind of domain ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I was thinking that depending on accounting choice, it was possible to make many different accounts.
you can add a domain, if you want. (but in the python part don't you think ?)
if vals["debit"] > 0: | ||
if self.payment_type == "inbound" and vals["debit"] > 0: | ||
vals.update({"account_wallet_id": self.account_wallet_id.id}) | ||
if self.payment_type == "outbound" and vals["credit"] > 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question : why the if ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're right, fixed !
Hey @legalsylvain, thank you for your Pull Request. It looks like some users haven't signed our Contributor License Agreement, yet.
Appreciation of efforts, |
answered to all comments. (except your remark regarding the HUGE change). |
@openupgrade.migrate() | ||
def migrate(env, version): | ||
if openupgrade.column_exists(env.cr, "account_wallet_type", "no_anonymous"): | ||
openupgrade.rename_columns( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TypeError: rename_columns() missing 1 required positional argument: 'column_spec'
should be
openupgrade.rename_columns( | |
openupgrade.rename_columns(env.cr, ... |
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
Finish #2
Clean and refactor
openupgradelib
dependency : 6f6392daccount.move
andaccount.move.line
c94432c b49885ano_anonymous
field intoautomatic_nominative_creation
because the description is better, to have the possibility to introduce a new fieldonly_nominative
and to prevent double negation : 0d0e392 (openupgrade script included).UX Improvment
account.wallet.type
73f2bb4Bugfixes
Add Feature
only_nominative
onaccount.wallet.type
to prevent wallet without partner defined. e8c4fa3account.payment.register
223e7efThis PR contains migration scripts. please call
ocabot merge
withnobump
option