Skip to content

Commit

Permalink
Add multi-inner-edition to bricks for related Invoice/Quote/SalesOrde…
Browse files Browse the repository at this point in the history
…r in 'opportunities'.
  • Loading branch information
genglert committed Nov 28, 2024
1 parent ebe8a69 commit e01a2f8
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 14 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
== Version 2.6.4 Work in progress (not released -- this is a draft) ==

TODO: compile i18n (core, billing)
TODO: compile i18n (core, billing, opportunities)

Users side :
------------
Expand All @@ -10,7 +10,8 @@
# Apps :
* Opportunities :
- In the blocks for related Invoices, Quotes & Sales Orders,
the color of the statuses were not displayed.
- The color of the statuses were not displayed.
- The multi-inner-edition have been added.

Developers side :
-----------------
Expand Down
15 changes: 12 additions & 3 deletions creme/opportunities/locale/fr/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Creme Opportunities 2.6\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-14 17:34+0200\n"
"POT-Creation-Date: 2024-11-27 21:35+0100\n"
"Last-Translator: Hybird <[email protected]>\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
Expand Down Expand Up @@ -510,8 +510,8 @@ msgstr "Générer une facture"
msgid "Link to an invoice"
msgstr "Lier à une facture"

msgid "Unlink"
msgstr "Délier"
msgid "Edit this invoice"
msgstr "Modifier cette facture"

msgid "Unlink this invoice"
msgstr "Délier cette facture"
Expand Down Expand Up @@ -631,6 +631,9 @@ msgstr "Oui"
msgid "No"
msgstr "Non"

msgid "Edit this quote"
msgstr "Modifier ce devis"

msgid "Unlink this quote"
msgstr "Délier ce devis"

Expand All @@ -654,6 +657,9 @@ msgstr "Générer un bon de commande"
msgid "Link to a salesorder"
msgstr "Lier à un bon"

msgid "Edit this salesorder"
msgstr "Modifier ce bon"

msgid "Unlink this salesorder"
msgstr "Délier ce bon"

Expand Down Expand Up @@ -735,6 +741,9 @@ msgstr "Créer un contact lié à «{opportunity}»"
msgid "New opportunity targeting «{entity}»"
msgstr "Nouvelle opportunité ciblant «{entity}»"

#~ msgid "Unlink"
#~ msgstr "Délier"

#~ msgid "forbidden"
#~ msgstr "interdit"

Expand Down
14 changes: 11 additions & 3 deletions creme/opportunities/templates/opportunities/bricks/invoices.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends 'creme_core/bricks/base/paginated-table.html' %}
{% load i18n creme_bricks creme_perms creme_widgets %}
{% load and_op print_field url from creme_core_tags %}
{% load i18n creme_bricks creme_cells creme_perms creme_widgets %}
{% load and_op inner_edition_uri listify print_field url from creme_core_tags %}

{% block brick_extra_class %}{{block.super}} opportunities-invoices-brick{% endblock %}

Expand Down Expand Up @@ -30,7 +30,7 @@
{% brick_table_column_for_field ctype=objects_ctype field='number' status='primary' %}
{% brick_table_column_for_field ctype=objects_ctype field='name' status='nowrap' %}
{% brick_table_column_for_field ctype=objects_ctype field='status' %}
{% brick_table_column title=_('Unlink') status='action' %}
{% brick_table_column title=_('Actions') status='action' colspan=2 %}
{% endblock %}

{% block brick_table_rows %}
Expand All @@ -43,6 +43,14 @@
</td>
<td>{% widget_entity_hyperlink invoice user %}</td>
<td>{% if invoice_view_perm %}{% print_field object=invoice field='status' %}{% else %}{{HIDDEN_VALUE}}{% endif %}</td>
<td {% brick_table_data_status action %}>
{% cell_4_regularfield model=invoice field="number" as number_cell %}
{% cell_4_regularfield model=invoice field="name" as name_cell %}
{% cell_4_regularfield model=invoice field="status" as status_cell %}
{% listify number_cell name_cell status_cell as cells %}
{% inner_edition_uri instance=invoice cells=cells as edition_uri %}
{% brick_table_action id='edit' url=edition_uri comeback=True label=_('Edit this invoice') enabled=user|has_perm_to_change:invoice %}
</td>
<td {% brick_table_data_status action %}>
{% with invoice_unlink_perm=user|has_perm_to_unlink:invoice %}
{% brick_table_action id='delete' url=delete_relation_url __subject_id=object.id __type=relation_type.id __object_id=invoice.id label=_('Unlink this invoice') icon='unlink' enabled=unlink_perm|and_op:invoice_unlink_perm %}
Expand Down
14 changes: 11 additions & 3 deletions creme/opportunities/templates/opportunities/bricks/quotes.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends 'creme_core/bricks/base/paginated-table.html' %}
{% load i18n creme_bricks creme_perms creme_widgets %}
{% load and_op in print_field url from creme_core_tags %}
{% load i18n creme_bricks creme_cells creme_perms creme_widgets %}
{% load and_op in inner_edition_uri listify print_field url from creme_core_tags %}

{% block brick_extra_class %}{{block.super}} opportunities-quotes-brick{% endblock %}

Expand Down Expand Up @@ -40,7 +40,7 @@
{% brick_table_column_for_field ctype=objects_ctype field='name' status='nowrap' %}
{% brick_table_column_for_field ctype=objects_ctype field='status' %}
{% brick_table_column title=_('Current quote?') status='nowrap' %}
{% brick_table_column title=_('Unlink') status='action' %}
{% brick_table_column title=_('Actions') status='action' colspan=2 %}
{% endblock %}

{% block brick_table_rows %}
Expand All @@ -63,6 +63,14 @@
{% translate 'No' %}
{% endif %}
</td>
<td {% brick_table_data_status action %}>
{% cell_4_regularfield model=quote field="number" as number_cell %}
{% cell_4_regularfield model=quote field="name" as name_cell %}
{% cell_4_regularfield model=quote field="status" as status_cell %}
{% listify number_cell name_cell status_cell as cells %}
{% inner_edition_uri instance=quote cells=cells as edition_uri %}
{% brick_table_action id='edit' url=edition_uri comeback=True label=_('Edit this quote') enabled=user|has_perm_to_change:quote %}
</td>
<td {% brick_table_data_status action %}>
{% brick_table_action id='delete' url=delete_relation_url __subject_id=object.id __type=relation_type.id __object_id=quote.id label=_('Unlink this quote') icon='unlink' enabled=unlink_perm|and_op:quote_unlink_perm %}
</td>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends 'creme_core/bricks/base/paginated-table.html' %}
{% load i18n creme_bricks creme_perms creme_widgets %}
{% load and_op print_field url from creme_core_tags %}
{% load i18n creme_bricks creme_cells creme_perms creme_widgets %}
{% load and_op inner_edition_uri listify print_field url from creme_core_tags %}

{% block brick_extra_class %}{{block.super}} opportunities-sales-orders-brick{% endblock %}

Expand Down Expand Up @@ -30,7 +30,7 @@
{% brick_table_column_for_field ctype=objects_ctype field='number' status='primary' %}
{% brick_table_column_for_field ctype=objects_ctype field='name' status='nowrap' %}
{% brick_table_column_for_field ctype=objects_ctype field='status' %}
{% brick_table_column title=_('Unlink') status='action' %}
{% brick_table_column title=_('Actions') status='action' colspan=2 %}
{% endblock %}

{% block brick_table_rows %}
Expand All @@ -43,6 +43,14 @@
</td>
<td>{% widget_entity_hyperlink salesorder user %}</td>
<td>{% if salesorder_view_perm %}{% print_field object=salesorder field='status' %}{% else %}{{HIDDEN_VALUE}}{% endif %}</td>
<td {% brick_table_data_status action %}>
{% cell_4_regularfield model=salesorder field="number" as number_cell %}
{% cell_4_regularfield model=salesorder field="name" as name_cell %}
{% cell_4_regularfield model=salesorder field="status" as status_cell %}
{% listify number_cell name_cell status_cell as cells %}
{% inner_edition_uri instance=salesorder cells=cells as edition_uri %}
{% brick_table_action id='edit' url=edition_uri comeback=True label=_('Edit this salesorder') enabled=user|has_perm_to_change:salesorder %}
</td>
<td {% brick_table_data_status action %}>
{% with salesorder_unlink_perm=user|has_perm_to_unlink:salesorder %}
{% brick_table_action id='delete' url=delete_relation_url __subject_id=object.id __type=relation_type.id __object_id=salesorder.id label=_('Unlink this salesorder') icon='unlink' enabled=unlink_perm|and_op:salesorder_unlink_perm %}
Expand Down

0 comments on commit e01a2f8

Please sign in to comment.