[TMP] beginning of state of last invoice
This commit is contained in:
parent
5f8433e112
commit
1531a3c7b8
@ -103,15 +103,6 @@ class GolemMember(models.Model):
|
||||
is_number_manual = fields.Boolean('Is number manual?', store=False,
|
||||
compute='_compute_is_number_manual')
|
||||
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')
|
||||
def _onchange_country_id(self):
|
||||
|
@ -33,7 +33,17 @@ class GolemMember(models.Model):
|
||||
""" Open invoices member """
|
||||
self.ensure_one()
|
||||
return {'type': 'ir.actions.act_window',
|
||||
'name': 'Invoices',
|
||||
'res_model': 'account.invoice',
|
||||
'view_mode': 'tree',
|
||||
'view_mode': 'tree,form',
|
||||
'context': {'search_default_partner_id': self.partner_id.id,
|
||||
'default_partner_id': self.partner_id.id}}
|
||||
|
||||
|
||||
# state_invoice = fields.One2many(related='member_id.invoice_ids')
|
||||
state_last_invoice = fields.Char(compute='_compute_state_of_last_invoice')
|
||||
|
||||
@api.depends('invoice_ids')
|
||||
def _compute_state_of_last_invoice(self):
|
||||
for member in self:
|
||||
if mem.invoice_ids.state == 'open':
|
||||
|
@ -35,10 +35,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
<span class="o_stat_value">
|
||||
<field name="total_invoiced" widget='monetary' options="{'currency_field': 'currency_id'}"/></span>
|
||||
<span class="o_stat_text">Invoiced</span>
|
||||
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<field name="season_ids" position="before">
|
||||
<field name="state_last_invoice" />
|
||||
</field>
|
||||
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user