[TMP] Button style and currency

This commit is contained in:
michel 2018-02-08 10:18:04 +01:00
parent 7e236226b7
commit 8c102ff103
2 changed files with 24 additions and 12 deletions

View File

@ -66,6 +66,7 @@ class ResPartner(models.Model):
gm_obj = self.env['golem.member'] gm_obj = self.env['golem.member']
gm_obj.create({'partner_id': self[0].id}) gm_obj.create({'partner_id': self[0].id})
class GolemMember(models.Model): class GolemMember(models.Model):
""" GOLEM Member model """ """ GOLEM Member model """
_name = 'golem.member' _name = 'golem.member'
@ -102,6 +103,15 @@ class GolemMember(models.Model):
is_number_manual = fields.Boolean('Is number manual?', store=False, is_number_manual = fields.Boolean('Is number manual?', store=False,
compute='_compute_is_number_manual') compute='_compute_is_number_manual')
image_permission = fields.Boolean('Image permission?', default=True) image_permission = fields.Boolean('Image permission?', default=True)
currency_id = fields.Many2one('res.currency', compute='_get_company_currency',
string="Currency")
@api.one
def _get_company_currency(self):
if self.company_id:
self.currency_id = self.sudo().company_id.currency_id
else:
self.currency_id = self.env.user.company_id.currency_id
@api.onchange('country_id') @api.onchange('country_id')
def _onchange_country_id(self): def _onchange_country_id(self):

View File

@ -28,17 +28,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<sheet> <sheet>
<div colspan="2" <div colspan="2"
style="background-color: #ccc; color: #fff; font-size: 150%; font-weight: bold; padding: 0.5%; text-align: center; margin-bottom: 1%;">Member form</div> style="background-color: #ccc; color: #fff; font-size: 150%; font-weight: bold; padding: 0.5%; text-align: center; margin-bottom: 1%;">Member form</div>
<div name="button_box" position="inside"> <div class="oe_button_box" name="button_box">
<button type="object" class="oe_stat_button" id="invoice_button" <button type="object" class="oe_stat_button" id="invoice_button"
icon="fa-pencil-square-o" name="open_partner_invoices" icon="fa-pencil-square-o" name="open_partner_invoices"
attrs="{'invisible': [('free_member', '=', True)]}" attrs="{'invisible': [('free_member', '=', True)]}"
context="{'default_partner_id': active_id}"> context="{'default_partner_id': active_id}">
<div class="o_form_field o_stat_info"> <div class="o_form_field o_stat_info">
<span class="o_stat_value"><field name="total_invoiced" widget='monetary' options="{'currency_field': 'currency_id'}"/></span> <span class="o_stat_value">
<span class="o_stat_text">Invoiced</span> <field name="total_invoiced" widget='monetary' options="{'currency_field': 'currency_id'}"/></span>
</div> <span class="o_stat_text">Invoiced</span>
</button> </div>
</div> </button>
</div>
<group> <group>
<div class="oe_title"> <div class="oe_title">
<h1> <h1>
@ -53,7 +55,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<field name="season_ids" widget="many2many_tags" /> <field name="season_ids" widget="many2many_tags" />
<field name="category_id" widget="many2many_tags" <field name="category_id" widget="many2many_tags"
placeholder="Tags..."/> placeholder="Tags..."/>
<field name="partner_id" /> <field name="currency_id" invisible="1"/>
</group> </group>
</group> </group>
<group string="Personal details"> <group string="Personal details">