[IMP] account: add setting to hide the products in bills

Was part of PR #26876
Was part of task #1882329
This commit is contained in:
qdp-odoo
2018-09-14 10:21:02 +02:00
parent c5393118c6
commit c52d809032
4 changed files with 27 additions and 1 deletions
@@ -43,6 +43,10 @@ class ResConfigSettings(models.TransientModel):
"Show line subtotals with taxes (B2C)",
implied_group='account.group_show_line_subtotals_tax_included',
group='base.group_portal,base.group_user,base.group_public')
group_products_in_bills = fields.Boolean(string="Use products in vendor bills",
implied_group='account.group_products_in_bills',
group='base.group_user',
help="Disable this option to use a simplified versions of vendor bills, where products are hidden.")
show_line_subtotals_tax_selection = fields.Selection([
('tax_excluded', 'Tax-Excluded'),
('tax_included', 'Tax-Included')], string="Line Subtotals Tax Display",
@@ -65,8 +65,14 @@
<field name="category_id" ref="base.module_category_hidden"/>
</record>
<record id="group_products_in_bills" model="res.groups">
<field name="name">Use products on vendor bills</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>
</data>
<data noupdate="1">
<record id="base.default_user" model="res.users">
<field name="groups_id" eval="[(4,ref('account.group_account_manager'))]"/>
@@ -183,5 +189,10 @@
<field name="domain_force">[('invoice_id.message_partner_ids','child_of',[user.commercial_partner_id.id])]</field>
<field name="groups" eval="[(4, ref('base.group_portal'))]"/>
</record>
<!-- Enable products on bills by default at installation -->
<record id="base.group_user" model="res.groups">
<field name="implied_ids" eval="[(4, ref('account.group_products_in_bills'))]"/>
</record>
</data>
</odoo>
@@ -308,7 +308,7 @@
<field context="{'type': type, 'journal_id': journal_id}" name="invoice_line_ids">
<tree string="Bill lines" editable="bottom">
<field name="sequence" widget="handle" />
<field name="product_id"
<field name="product_id" groups="account.group_products_in_bills"
context="{'partner_id': parent.partner_id}" domain="[('purchase_ok','=',True)]"/>
<field name="name"/>
<field name="company_id" invisible="1"/>
@@ -537,6 +537,17 @@
</div>
</div>
</div>
<div class="col-xs-12 col-md-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="group_products_in_bills"/>
</div>
<div class="o_setting_right_pane">
<label for="group_products_in_bills"/>
<div class="text-muted">
Disable to have a simplified view of vendor bills, without the products.
</div>
</div>
</div>
</div>
<h2 groups="account.group_account_user">Automated Entries</h2>
<div class="row mt16 o_settings_container" id="recommended_apps" groups="account.group_account_user">