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

OPL-6: Added Invoice graphQL #7

Merged
merged 7 commits into from Oct 19, 2021
Merged

OPL-6: Added Invoice graphQL #7

merged 7 commits into from Oct 19, 2021

Conversation

dborowiecki
Copy link
Contributor

TICKET: OPL-6

Copy link
Member

@delcroip delcroip left a comment

Choose a reason for hiding this comment

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

Please check the perm points also the folder name is not aligned anymore with the app name, can you rename the folder invoice instead of invoice_payment ?


"description": ["istartswith", "icontains", "iexact"],

"ledger_account": ["iexact"],
Copy link
Member

Choose a reason for hiding this comment

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

I think ["istartswith", "iexact"], will be better so you can type only the begining

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed

"code_rcp": ["istartswith", "icontains", "iexact"],
"code_receipt": ["istartswith", "icontains", "iexact"],

"label": ["iexact"],
Copy link
Member

Choose a reason for hiding this comment

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

I think ["istartswith", "iexact"], will be better

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed

def _validate_mutation(cls, user, **data):
# TODO: What permissions should be used?
if type(user) is AnonymousUser or not user.id or not user.has_perms(
PolicyConfig.gql_mutation_create_policies_perms):
Copy link
Member

Choose a reason for hiding this comment

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

why this perm .gql_mutation_create_policies_perms ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Perms have been changed to the valid ones for this module.



def get_default_currency():
return InvoicePaymentConfig.default_currency_code


class Invoice(HistoryBusinessModel):
class Invoice(GenericInvoiceQuerysetMixin, HistoryBusinessModel):
Copy link
Member

Choose a reason for hiding this comment

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

as you add the mixin, can you change the recipient to thirdparty or you want to do another PR for that ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you elaborate, is the idea to create a mixin that would allow to use queries generically depending on whether invoice or bill is considered? if that's the case I think it'd be better to create separate PR, since this one is already quite big.

Copy link
Member

Choose a reason for hiding this comment

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

we will discuss it tomorrow

Copy link
Contributor

@sniedzielski sniedzielski left a comment

Choose a reason for hiding this comment

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

@dborowiecki Please refer to this comment related to permissions.

invoice/apps.py Outdated
"gql_invoice_payment_delete_perms": ["155204"],
"gql_invoice_payment_refund_perms": ["155206"],

"gql_invoice_event_search_perms": ["155201"],
Copy link
Contributor

Choose a reason for hiding this comment

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

@dborowiecki Is this value correct? According to the wiki page - should be "155301" etc for 'EventInvoice'. https://openimis.atlassian.net/wiki/spaces/OP/pages/2858254346/Account+receivable+-+outbound+invoices

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, fixed



def get_default_currency():
return InvoicePaymentConfig.default_currency_code


class Invoice(HistoryBusinessModel):
class Invoice(GenericInvoiceQuerysetMixin, HistoryBusinessModel):
Copy link
Member

Choose a reason for hiding this comment

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

we will discuss it tomorrow

@delcroip delcroip merged commit c1696b0 into develop Oct 19, 2021
@delcroip delcroip deleted the feature/OPL-6 branch October 19, 2021 11:12
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.

None yet

3 participants