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
Conversation
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 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 ?
invoice/gql/gql_types.py
Outdated
|
||
"description": ["istartswith", "icontains", "iexact"], | ||
|
||
"ledger_account": ["iexact"], |
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 think ["istartswith", "iexact"], will be better so you can type only the begining
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.
Changed
invoice/gql/gql_types.py
Outdated
"code_rcp": ["istartswith", "icontains", "iexact"], | ||
"code_receipt": ["istartswith", "icontains", "iexact"], | ||
|
||
"label": ["iexact"], |
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 think ["istartswith", "iexact"], will be better
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.
Changed
invoice/gql/invoice/mutation.py
Outdated
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): |
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.
why this perm .gql_mutation_create_policies_perms ?
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.
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): |
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.
as you add the mixin, can you change the recipient to thirdparty or you want to do another PR for that ?
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.
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.
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.
we will discuss it tomorrow
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.
@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"], |
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.
@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
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.
Good catch, fixed
|
||
|
||
def get_default_currency(): | ||
return InvoicePaymentConfig.default_currency_code | ||
|
||
|
||
class Invoice(HistoryBusinessModel): | ||
class Invoice(GenericInvoiceQuerysetMixin, HistoryBusinessModel): |
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.
we will discuss it tomorrow
TICKET: OPL-6