Merge branch 'master-pos' into 'master'

[FIX]: POS: Remove field and Attrs.

See merge request flectra-hq/flectra!132
This commit is contained in:
Parthiv Patel 2018-08-09 08:56:34 +00:00
commit d2d959f597
2 changed files with 14 additions and 19 deletions

View File

@ -61,7 +61,6 @@ class PosConfig(models.Model):
return self.env['ir.qweb'].render('point_of_sale.customer_facing_display_html')
name = fields.Char(string='Point of Sale Name', index=True, required=True, help="An internal identification of the point of sale.")
is_installed_account_accountant = fields.Boolean(compute="_compute_is_installed_account_accountant")
journal_ids = fields.Many2many(
'account.journal', 'pos_config_journal_rel',
'pos_config_id', 'journal_id', string='Available Payment Methods',
@ -163,11 +162,6 @@ class PosConfig(models.Model):
is_posbox = fields.Boolean("PosBox")
is_header_or_footer = fields.Boolean("Header & Footer")
def _compute_is_installed_account_accountant(self):
account_accountant = self.env['ir.module.module'].sudo().search([('name', '=', 'account_accountant'), ('state', '=', 'installed')])
for pos_config in self:
pos_config.is_installed_account_accountant = account_accountant and account_accountant.id
@api.depends('journal_id.currency_id', 'journal_id.company_id.currency_id')
def _compute_currency(self):
for pos_config in self:

View File

@ -31,7 +31,6 @@
<form string="Point of Sale Configuration">
<sheet>
<field name="currency_id" invisible="1"/>
<field name="is_installed_account_accountant" invisible="1"/>
<div class="oe_button_box" name="button_box">
<button name="toggle_active" type="object" class="oe_stat_button" icon="fa-archive">
<field name="active" widget="boolean_button" options='{"terminology": "archive"}'/>
@ -450,29 +449,31 @@
</div>
</div>
</div>
<h2 attrs="{'invisible': [('is_installed_account_accountant', '=', False)]}">Accounting</h2>
<div class="row mt16 o_settings_container" attrs="{'invisible': [('is_installed_account_accountant', '=', False)]}">
<div class="col-xs-12 col-md-6 o_setting_box">
<h2>Accounting</h2>
<div class="row mt16 o_settings_container">
<div class="col-xs-12 col-md-6 o_setting_box" title="Whenever you close a session, one entry is generated in the following accounting journal for all the orders not invoiced. Invoices are recorded in accounting separately.">
<div class="o_setting_right_pane">
<label string="Journal Entries"/>
<div class="text-muted">
Configuration for journal entries of PoS orders
</div>
<div class="content-group">
<div class="row mt16" title="Whenever you close a session, one entry is generated in the following accounting journal for all the orders not invoiced. Invoices are recorded in accounting separately.">
<label string="Sales Journal" for="journal_id" class="col-md-3 o_light_label" widget="selection"/>
<field name="journal_id"/>
</div>
<div class="row" groups="account.group_account_user" title="Get one journal item per product rather than one journal item per receipt line. This works for any anonymous order. If the customer is set on the order, one journal item is created for each receipt line. This option is recommended for an easy review of your journal entries when managing lots of orders.">
<label string="Group Journal Items" for="group_by" class="col-md-3 o_light_label"/>
<field name="group_by"/>
<div class="content-group" >
<div class="content-group mt16" >
<field name="journal_id" widget="selection"/>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-md-6 o_setting_box" id="group_by" title="Get one journal item per product rather than one journal item per receipt line. This works for any anonymous order. If the customer is set on the order, one journal item is created for each receipt line. This option is recommended for an easy review of your journal entries when managing lots of orders.">
<div class="o_setting_left_pane">
<field name="group_by"/>
</div>
<div class="o_setting_right_pane">
<label string="Group Journal Items" for="group_by"/>
</div>
</div>
</div>
</sheet>
</form>
</field>
</record>