mirror of
https://github.com/bringout/oca-ocb-vertical-industry.git
synced 2026-04-23 04:12:05 +02:00
19.0 vanilla
This commit is contained in:
parent
4607ccbd2e
commit
825ff6514e
487 changed files with 184979 additions and 195262 deletions
|
|
@ -1,29 +1,30 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import api, fields, models, tools, _
|
||||
from odoo import fields, models, tools, _
|
||||
|
||||
|
||||
class CashmoveReport(models.Model):
|
||||
_name = "lunch.cashmove.report"
|
||||
class LunchCashmoveReport(models.Model):
|
||||
_name = 'lunch.cashmove.report'
|
||||
_description = 'Cashmoves report'
|
||||
_auto = False
|
||||
_order = "date desc"
|
||||
|
||||
id = fields.Integer('ID')
|
||||
id = fields.Id(string='ID')
|
||||
amount = fields.Float('Amount')
|
||||
date = fields.Date('Date')
|
||||
currency_id = fields.Many2one('res.currency', string='Currency')
|
||||
user_id = fields.Many2one('res.users', string='User')
|
||||
description = fields.Text('Description')
|
||||
|
||||
def name_get(self):
|
||||
return [(cashmove.id, '%s %s' % (_('Lunch Cashmove'), '#%d' % cashmove.id)) for cashmove in self]
|
||||
def _compute_display_name(self):
|
||||
for cashmove in self:
|
||||
cashmove.display_name = '{} {}'.format(_('Lunch Cashmove'), '#%d' % cashmove.id)
|
||||
|
||||
def init(self):
|
||||
tools.drop_view_if_exists(self._cr, self._table)
|
||||
tools.drop_view_if_exists(self.env.cr, self._table)
|
||||
|
||||
self._cr.execute("""
|
||||
self.env.cr.execute("""
|
||||
CREATE or REPLACE view %s as (
|
||||
SELECT
|
||||
lc.id as id,
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
<search string="lunch cashmove">
|
||||
<field name="description"/>
|
||||
<field name="user_id"/>
|
||||
<group expand="0" string="Group By">
|
||||
<group>
|
||||
<filter name='group_by_user' string="By Employee" context="{'group_by':'user_id'}"/>
|
||||
</group>
|
||||
</search>
|
||||
|
|
@ -30,29 +30,29 @@
|
|||
</record>
|
||||
|
||||
<record id="lunch_cashmove_report_view_tree" model="ir.ui.view">
|
||||
<field name="name">lunch.cashmove.report.tree</field>
|
||||
<field name="name">lunch.cashmove.report.list</field>
|
||||
<field name="model">lunch.cashmove.report</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="cashmove tree">
|
||||
<field name="currency_id" invisible="1"/>
|
||||
<list string="cashmove list">
|
||||
<field name="currency_id" column_invisible="True"/>
|
||||
<field name="date"/>
|
||||
<field name="user_id"/>
|
||||
<field name="user_id" widget="many2one_avatar_user"/>
|
||||
<field name="description"/>
|
||||
<field name="amount" sum="Total" widget="monetary"/>
|
||||
</tree>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="lunch_cashmove_report_view_tree_2" model="ir.ui.view">
|
||||
<field name="name">lunch.cashmove.report.tree</field>
|
||||
<field name="name">lunch.cashmove.report.list</field>
|
||||
<field name="model">lunch.cashmove.report</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="cashmove tree" create='false'>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
<list string="cashmove list" create='false'>
|
||||
<field name="currency_id" column_invisible="True"/>
|
||||
<field name="date"/>
|
||||
<field name="description"/>
|
||||
<field name="amount" sum="Total" widget="monetary"/>
|
||||
</tree>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
|
@ -64,7 +64,7 @@
|
|||
<sheet>
|
||||
<group>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
<field name="user_id" required="1"/>
|
||||
<field name="user_id" required="1" widget="many2one_avatar"/>
|
||||
<field name="date"/>
|
||||
<field name="amount" widget="monetary"/>
|
||||
</group>
|
||||
|
|
@ -80,36 +80,23 @@
|
|||
<field name="model">lunch.cashmove.report</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban class="o_kanban_mobile">
|
||||
<field name="date"/>
|
||||
<field name="user_id"/>
|
||||
<field name="description"/>
|
||||
<field name="amount"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
<field name="currency_id"/>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div t-attf-class="oe_kanban_global_click">
|
||||
<div class="row mb4">
|
||||
<div class="col-8">
|
||||
<span>
|
||||
<strong class="o_kanban_record_title"><t t-esc="record.description.value"/></strong>
|
||||
</span>
|
||||
</div>
|
||||
<div class="col-4 text-end">
|
||||
<span class="badge rounded-pill">
|
||||
<strong><i class="fa fa-money" role="img" aria-label="Amount" title="Amount"/> <field name="amount" widget="monetary"/></strong>
|
||||
</span>
|
||||
</div>
|
||||
<t t-name="card">
|
||||
<div class="row mb4">
|
||||
<div class="col-8 fw-bold fs-5">
|
||||
<field name="description" />
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<i class="fa fa-clock-o" role="img" aria-label="Date" title="Date"/>
|
||||
<t t-esc="record.date.value"/>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<div class="float-end">
|
||||
<field name="user_id" widget="many2one_avatar_user"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 text-end badge rounded-pill fw-bolder pe-3 pt-1">
|
||||
<i class="fa fa-money" role="img" aria-label="Amount" title="Amount"/> <field name="amount" widget="monetary"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<i class="fa fa-clock-o" role="img" aria-label="Date" title="Date"/> <field name="date"/>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<field name="user_id" widget="many2one_avatar_user" class="float-end"/>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
|
|
@ -121,7 +108,7 @@
|
|||
<record id="lunch_cashmove_report_action_account" model="ir.actions.act_window">
|
||||
<field name="name">My Account</field>
|
||||
<field name="res_model">lunch.cashmove.report</field>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_mode">list</field>
|
||||
<field name="search_view_id" ref="lunch_cashmove_report_view_search"/>
|
||||
<field name="domain">[('user_id','=',uid)]</field>
|
||||
<field name="view_id" ref="lunch_cashmove_report_view_tree_2"/>
|
||||
|
|
@ -138,7 +125,7 @@
|
|||
<record id="lunch_cashmove_report_action_control_accounts" model="ir.actions.act_window">
|
||||
<field name="name">Control Accounts</field>
|
||||
<field name="res_model">lunch.cashmove.report</field>
|
||||
<field name="view_mode">tree,kanban,form</field>
|
||||
<field name="view_mode">list,kanban,form</field>
|
||||
<field name="search_view_id" ref="lunch_cashmove_report_view_search_2"/>
|
||||
<field name="context">{"search_default_group_by_user":1}</field>
|
||||
<field name="view_id" ref="lunch_cashmove_report_view_tree"/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue