-
-
Notifications
You must be signed in to change notification settings - Fork 523
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
[IMP] contract: Allow to single invoice a contract by users #1005
base: 14.0
Are you sure you want to change the base?
Conversation
Why this? You already have the button to manually invoice it on the contract itsel. |
That button is only accessible on debug mode, and it does not verify dates, so, If I push the button three times It will create the invoice three times. Wit my new way an standard user can create the invoices without worrying if he/she is doing something wrong |
Then I think it's better to fine tune that button, showing it to billing users, and showing the popup to decide if force or not to make the invoice. |
So, should I keep my button and remove the old one? |
I think it should be only one button to do both things according a check saying to force or not. |
4ad40fc
to
5b7145f
Compare
functionnal test OK |
26d0010
to
de73045
Compare
any issue w/ this one? |
Just waiting for approvals |
ok thanks |
good for me |
… controlled way It should allow you to process sale orders and other kinds Remove the extra button not necessary any more
if the method creating invoice generates more than one invoice, we have `[account.move(ID1, ID2)` for example and the `message_post()` fails w/ a `singleton error. Adding a loop level allows to properly post messages no matter of the number of invoices generated by the wizard
f45167c
to
441d767
Compare
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. |
@pedrobaeza I think the changes fits your requests 😄 |
@@ -633,17 +664,24 @@ def _get_recurring_create_func(self, create_type="invoice"): | |||
return self.__class__._recurring_create_invoice | |||
|
|||
@api.model | |||
def _cron_recurring_create(self, date_ref=False, create_type="invoice"): | |||
def _cron_recurring_create( | |||
self, date_ref=False, create_type="invoice", domain=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.
Changing the number of arguments is conflicting, as any override of this method won't know about the new argument, and it will fail, or at least, ignore this new argument. Can you avoid it?
@@ -317,7 +321,9 @@ def test_contract_invoice_followers(self): | |||
self.contract.message_subscribe( | |||
partner_ids=self.contract.partner_id.ids, subtype_ids=subtype_ids | |||
) | |||
self.contract._recurring_create_invoice() | |||
self.env["contract.manually.single.invoice"].create( |
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.
I don't think you should change this test, but only add a new one for the new use case. This also proves that there's no change in the previous behavior for compatibility reasons.
name="%(contract.contract_manually_single_invoice_act_window)s" | ||
type="action" | ||
string="Process manually" | ||
context="{'default_contract_id': id, 'default_date': recurring_next_date}" |
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.
Use active_id
instead
type="action" | ||
string="Process manually" | ||
context="{'default_contract_id': id, 'default_date': recurring_next_date}" | ||
attrs="{'invisible': [('id', '=', False)]}" |
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.
Hide it in the generation_type is not invoice.
@@ -574,6 +601,10 @@ def recurring_create_invoice(self): | |||
This method triggers the creation of the next invoices of the contracts | |||
even if their next invoicing date is in the future. | |||
""" | |||
_logger.warning( |
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.
I don't get why repeating the message_post code.
<field name="model">contract.manually.single.invoice</field> | ||
<field name="arch" type="xml"> | ||
<form string="Contract Manually Single Invoice"> | ||
<!-- TODO --> |
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.
?
@@ -70,6 +74,10 @@ def recurring_create_sale(self): | |||
This method triggers the creation of the next sale order of the | |||
contracts even if their next sale order date is in the future. | |||
""" | |||
_logger.warning( |
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 is for sales, not invoices.
It should allow you to process sale orders and other kinds, as it is using the cron function
@dixmit