Expose products setting for type 2 UPC lookup

also expose Configure button for most master view pages
This commit is contained in:
Lance Edgar 2021-12-23 15:18:30 -06:00
parent 33af2e6fa1
commit 819ae22b0e
4 changed files with 40 additions and 7 deletions

View file

@ -162,7 +162,7 @@
<li>${h.link_to("Create a new {}".format(model_title), url('{}.create'.format(route_prefix)))}</li>
% endif
% endif
% if master.configurable and master.has_perm('configure'):
% if not use_buefy and master.configurable and master.has_perm('configure'):
<li>${h.link_to("Configure {}".format(config_title), url('{}.configure'.format(route_prefix)))}</li>
% endif
% if master.has_input_file_templates and master.has_perm('download_template'):

View file

@ -29,6 +29,19 @@
</div>
<h3 class="block is-size-3">Handling</h3>
<div class="block" style="padding-left: 2rem;">
<b-field message="If set, GPC values like 002XXXXXYYYYY-Z will be converted to 002XXXXX00000-Z for lokkup">
<b-checkbox name="rattail.products.convert_type2_for_gpc_lookup"
v-model="simpleSettings['rattail.products.convert_type2_for_gpc_lookup']"
@input="settingsNeedSaved = true">
Auto-convert Type 2 UPC for sake of lookup
</b-checkbox>
</b-field>
</div>
<h3 class="block is-size-3">Display</h3>
<div class="block" style="padding-left: 2rem;">

View file

@ -304,12 +304,14 @@
${h.link_to(instance_title, instance_url)}
</span>
% elif master.creatable and master.show_create_link and master.has_perm('create'):
<once-button type="is-primary"
tag="a" href="${url('{}.create'.format(route_prefix))}"
icon-left="plus"
style="margin-left: 1rem;"
text="Create New">
</once-button>
% if not request.matched_route.name.endswith('.create'):
<once-button type="is-primary"
tag="a" href="${url('{}.create'.format(route_prefix))}"
icon-left="plus"
style="margin-left: 1rem;"
text="Create New">
</once-button>
% endif
% endif
% if master.viewing and grid_index:
${grid_index_nav()}
@ -367,6 +369,19 @@
</div>
% endif
% if master.configurable and master.has_perm('configure'):
% if not request.matched_route.name.endswith('.configure'):
<div class="level-item">
<once-button type="is-primary"
tag="a"
href="${url('{}.configure'.format(route_prefix))}"
icon-left="cog"
text="Configure">
</once-button>
</div>
% endif
% endif
## Theme Picker
% if expose_theme_picker and request.has_perm('common.change_app_theme'):
<div class="level-item">

View file

@ -1919,6 +1919,11 @@ class ProductView(MasterView):
{'section': 'rattail',
'option': 'product.key_title'},
# handling
{'section': 'rattail',
'option': 'products.convert_type2_for_gpc_lookup',
'type': bool},
# display
{'section': 'tailbone',
'option': 'products.show_pod_image',