Skip to content

[18.0][FIX] contract_manually_invoiced: wizard invoice manually view#1408

Open
jbaudoux wants to merge 1 commit intoOCA:18.0from
jbaudoux:18-fix-contract_invoiced_manually
Open

[18.0][FIX] contract_manually_invoiced: wizard invoice manually view#1408
jbaudoux wants to merge 1 commit intoOCA:18.0from
jbaudoux:18-fix-contract_invoiced_manually

Conversation

@jbaudoux
Copy link
Contributor

The wizard to invoice manually was not displayed properly.
I also allow to choose to invoice only the manually invoiced contracts or not.
I removed the button to view the contracts as this is there by default in contract module.

cc @tobiaszehntner

Copy link
Contributor

@tobiaszehntner tobiaszehntner left a comment

Choose a reason for hiding this comment

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

You hide the filter to debug-mode while adding the boolean. The idea of the filter is that the user can do all specifics they would like, including choosing non-manually-invoiced contracts.

If we add the boolean for user-friendliness, I would suggest to make it clearer ('Only include manually invoice contracts'), and avoid excluding them if it's unticked.

<group
string="Contract Filter"
invisible="not invoice_date"
groups="base.group_no_one"
Copy link
Contributor

Choose a reason for hiding this comment

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

I find it's too limiting to put the filter only for debug-mode. Our clients use filtering regularly but aren't necessarily familiar with debug mode. However, I agree it's a bit of an extra technical thing, hence my reasoning to put it away in a second tab: accessible but not confusing.

<xpath expr="//form/group[last()]" position="after">
<notebook invisible="not invoice_date">
<page name="contracts" string="Contracts">
<button
Copy link
Contributor

Choose a reason for hiding this comment

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

the button is fixed here: #1391

class ContractManuallyCreateInvoice(models.TransientModel):
_inherit = "contract.manually.create.invoice"

manually_invoiced = fields.Boolean(
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
manually_invoiced = fields.Boolean(
is_manually_invoiced = fields.Boolean(
"Only Manually Invoiced Contracts

Yes that could add some flexibility (even though it's already there via the filter for the technically versed users)

Comment on lines +35 to -33
("is_manually_invoiced", "=", wizard.manually_invoiced),
]
if self.env.company.enable_contract_invoice_manually:
domain = expression.AND([domain, [("is_manually_invoiced", "=", True)]])
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know what your use case is, but I think it's not clear from the boolean in the view that unticking it would exclude the manually invoiced contracts. Maybe only add the domain if it's ticked, and otherwise include both types of contracts?

</page>
</notebook>
<field name="invoice_date" position="after">
<field name="manually_invoiced" />
Copy link
Contributor

Choose a reason for hiding this comment

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

This should only show when the config setting is active

@jbaudoux
Copy link
Contributor Author

You hide the filter to debug-mode while adding the boolean. The idea of the filter is that the user can do all specifics they would like, including choosing non-manually-invoiced contracts.

If we add the boolean for user-friendliness, I would suggest to make it clearer ('Only include manually invoice contracts'), and avoid excluding them if it's unticked.

@tobiaszehntner Thanks for the feedback. For the manually invoiced contracts, the most convenient I find is to select some contracts from the list view and launch a "create invoice" action. You can use the standard filters on the list view (To Invoice & Manually Invoiced).
The wizard was used for automaticaly invoiced contracts, to launch the invoicing when you don't use the cron. I found it suddenly unfriendly to have this filter changing the base behavior.
I agree this boolean is not ideal. Maybe an expliclit selection "Only non manually invoiced", "Only manually invoiced", "Both" would be better.
Nevertheless, I still find it strange to invoice in mass manually invoiced contracts, but it's up to the user to decide. It's more usefull for automaticaly invoiced contracts like it's with the base module. And for manually invoiced contracts to manage them one by one without the wizard.

@tobiaszehntner
Copy link
Contributor

@jbaudoux you seem to describe the basic behavior from contract no? This is why this is a separate module with a company config. It's because our client has some contracts that are always manually invoiced (but hundreds of them), and it makes it easier to do that with the boolean on the contract and through the wizard. If you want to manually invoice contracts that you select in list view, and use the wizard occasionally, you indeed might not need this module?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants