Merge branch 'master-pos' into 'master'

[FIX]: POS: Remove field and Attrs.

See merge request flectra-hq/flectra!40
This commit is contained in:
Parthiv Patel 2018-03-29 05:57:51 +00:00
commit e7e68907d4
2 changed files with 13 additions and 15 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,10 +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):

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,8 +449,8 @@
</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)]}">
<h2>Accounting</h2>
<div class="row mt16 o_settings_container">
<div class="col-xs-12 col-md-6 o_setting_box">
<div class="o_setting_right_pane">
<label string="Journal Entries"/>
@ -459,18 +458,22 @@
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 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.">
<field name="journal_id" widget="selection"/>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-md-6 o_setting_box" id="group_by">
<div class="o_setting_left_pane">
<field name="group_by"/>
</div>
<div class="o_setting_right_pane" 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"/>
</div>
</div>
</div>
</sheet>
</form>