This commit is contained in:
李鹏宇
2025-02-24 10:53:39 +08:00
parent 961ea1ae0e
commit 2fcd04c216
8 changed files with 21 additions and 140 deletions
+6 -6
View File
@@ -29,12 +29,12 @@ class preview(http.Controller):
if attach.mimetype in image or attach.mimetype in video or attach.mimetype in pdf or attach.mimetype in html or attach.mimetype in txt:
headers = [('Content-Type', attach.mimetype)]
return werkzeug.wrappers.Response(attach.raw, status=200, headers=headers)
elif attach.mimetype in word:
with io.BytesIO(attach.raw) as file:
result = mammoth.convert_to_html(file)
html = result.value
return template.render(html=html)
elif attach.mimetype in excel:
# elif attach.mimetype in word:
# with io.BytesIO(attach.raw) as file:
# result = mammoth.convert_to_html(file)
# html = result.value
# return template.render(html=html)
elif attach.mimetype in [excel, word]:
office_view_url = 'http://view.officeapps.live.com/op/view.aspx?src='
base_url = request.env['ir.config_parameter'].sudo().get_param('web.base.url')
html = f'{office_view_url}{quote(base_url + "/web/content/office_preview/" + str(attach.id))}'
@@ -14,6 +14,7 @@
</xpath>
</field>
</record>
<record id="view_employee_inherit_tree_soong" model="ir.ui.view">
<field name="name">hr.employee.inherit.del.form</field>
<field name="model">hr.employee</field>
@@ -24,15 +25,4 @@
</xpath>
</field>
</record>
<record id="inherit_view_employee_filter" model="ir.ui.view">
<field name="name">inherit.view.employee.filter</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_filter"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='department_id']" position="after">
<field name="user_role_id" enable_counters="1"/>
</xpath>
</field>
</record>
</odoo>
@@ -24,16 +24,14 @@ class PropertyAccountsReceivable(models.Model):
discount_amount = fields.Float(string='减免金额')
multiplier = fields.Integer(string='季度')
remark = fields.Text(string='备注')
is_invalid = fields.Boolean(string='作废')
is_red = fields.Boolean(string='红冲')
red_date = fields.Date(string='红冲日期')
charge_status = fields.Selection([('unpaid', '未收'), ('fully_paid', '已收')], string='收费状态')
is_invoice = fields.Boolean(string='开票')
is_suspend = fields.Boolean(string='挂起')
create_time = fields.Datetime(string='创建时间', default=fields.Datetime.now)
condition = fields.Selection([('red', '红冲'), ('invalid', '作废')], string='状态')
is_billing = fields.Boolean(string='开票')
is_reconciliation = fields.Boolean(string='对账')
is_invalid = fields.Boolean(string='作废')
is_red = fields.Boolean(string='红冲')
is_push = fields.Boolean(string='已推送')
management_type_id = fields.Many2one('yuthon.management.type', string='应收类型')
last_update_time = fields.Datetime(string='最后修改时间')
@@ -19,10 +19,10 @@ class PropertyElectricReading(models.Model):
other = fields.Char(string='其他')
billing_period = fields.Date(string='账期')
meter_date= fields.Date(string='抄表年月')
last_dosage = fields.Float(string='上次')
last_dosage = fields.Float(string='上次用量')
maximum_count = fields.Float(string='最大计数', default=999999)
last_meter = fields.Date(string='上次抄表日期')
current_meter = fields.Float(string='本次', tracking=True)
current_meter = fields.Float(string='本次用量', tracking=True)
fee_id = fields.Many2one('yuthon.water.setting', string="收费标准")
price_unit = fields.Float(string='单价')
ratio = fields.Float(string='倍率')
@@ -21,9 +21,9 @@ class PropertyWaterReading(models.Model):
other = fields.Char(string='其他')
billing_period = fields.Date(string='账期')
meter_date= fields.Date(string='抄表年月')
last_dosage = fields.Float(string='上次')
last_dosage = fields.Float(string='上次用量')
last_meter = fields.Date(string='上次抄表日期')
current_meter = fields.Float(string='本次', tracking=True)
current_meter = fields.Float(string='本次用量', tracking=True)
fee_id = fields.Many2one('yuthon.water.setting', string="收费标准")
price_unit = fields.Float(string='单价')
ratio = fields.Float(string='倍率')
@@ -19,32 +19,8 @@
<field name="last_update_time" optional="hide"/>
<field name="condition"/>
<field name="is_billing"/>
<field name="is_reconciliation"/>
<button name="unlink" string="删除" type="object" class="oe_highlight"/>
</tree>
</field>
</record>
<!--开票 -->
<record id="view_property_accounts_receivable_tree2" model="ir.ui.view">
<field name="name">property.accounts.receivable.tree</field>
<field name="model">property.accounts.receivable</field>
<field name="arch" type="xml">
<tree editable="bottom" string="应收列表" decoration-danger = "charge_status == 'unpaid'"
decoration-success="charge_status == 'fully_paid'">
<field name="due_date"/>
<field name="lessee_id"/>
<field name="admin_id"/>
<field name="company_id"/>
<field name="rent_month"/>
<field name="tax"/>
<field name="invoicing_type"/>
<field name="title_certificate" string="产权证号"/>
<field name="remark"/>
<field name="charge_status" column_invisible="1"/>
<field name="multiplier" column_invisible="1"/>
<field name="is_push" column_invisible="1"/>
<field name="condition"/>
<field name="is_billing"/>
<field name="is_invalid"/>
<field name="is_red"/>
<field name="is_reconciliation"/>
<button name="unlink" string="删除" type="object" class="oe_highlight"/>
</tree>
@@ -203,7 +203,7 @@
<field name="inherit_id" ref="yuthon_property.view_property_meter_archives_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='pre_existing_balances']" position="after">
<button name="button_reading_push" type="object" string="推送" class="btn-primary"/>
<button name="button_reading_push" type="object" string="推送" class="btn-primary"/>
</xpath>
</field>
</record>
@@ -286,7 +286,7 @@
<field name="contract_id" string="合同"/>
</xpath>
<xpath expr="//field[@name='remarks']" position="after">
<button name="push_management" string="推送" type="object" class="oe_highlight"/>
<button name="push_management" string="推送" type="object" class="oe_highlight"/>
</xpath>
</field>
</record>
@@ -313,64 +313,10 @@
<field name="contract_id" string="合同"/>
</xpath>
<xpath expr="//field[@name='is_reconciliation']" position="after">
<button name="receivable_return" string="退回" class="btn-primary" type="object"/>
<button name="receivable_return" string="退回" class="btn-primary" type="object"/>
</xpath>
</field>
</record>
<record id="view_property_rent_billing_action" model="ir.actions.act_window">
<field name="name">已开票</field>
<field name="res_model">property.accounts.receivable</field>
<field name="view_mode">tree,search</field>
<field name="domain">[('is_billing', '=', True), ('is_push', '=', True)]</field>
<field name="context">{'search_default_group_lessee_id': 1}</field>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'tree', 'view_id': ref('yuthon_property.view_property_accounts_receivable_tree2')})]"/>
</record>
<record id="view_property_rent_not_billing_action" model="ir.actions.act_window">
<field name="name">待开票</field>
<field name="res_model">property.accounts.receivable</field>
<field name="view_mode">tree,search</field>
<field name="domain">[('is_billing', '=', False)]</field>
<field name="context">{'search_default_group_lessee_id': 1}</field>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'tree', 'view_id': ref('yuthon_property.view_property_accounts_receivable_tree')})]"/>
</record>
<record id="view_property_rent_reconciliation_action" model="ir.actions.act_window">
<field name="name">对账</field>
<field name="res_model">property.accounts.receivable</field>
<field name="view_mode">tree,search</field>
<field name="context">{'search_default_group_lessee_id': 1}</field>
<field name="domain">[('is_reconciliation', '=', True), ('is_billing', '=', True)]</field>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'tree', 'view_id': ref('yuthon_property.view_property_accounts_receivable_tree')})]"/>
</record>
<record id="view_property_rent_not_reconciliation_action" model="ir.actions.act_window">
<field name="name">未对账</field>
<field name="res_model">property.accounts.receivable</field>
<field name="view_mode">tree,search</field>
<field name="context">{'search_default_group_lessee_id': 1}</field>
<field name="domain">[('is_reconciliation', '=', False), ('is_billing', '=', True)]</field>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'tree', 'view_id': ref('yuthon_property.view_property_accounts_receivable_tree')})]"/>
</record>
<record id="view_property_rent_red_action" model="ir.actions.act_window">
<field name="name">红冲</field>
<field name="res_model">property.accounts.receivable</field>
<field name="view_mode">tree,search</field>
<field name="context">{'search_default_group_lessee_id': 1}</field>
<field name="domain">[('condition', '=', 'red')]</field>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'tree', 'view_id': ref('yuthon_property.view_property_accounts_receivable_tree')})]"/>
</record>
<record id="view_property_rent_invalid_action" model="ir.actions.act_window">
<field name="name">作废</field>
<field name="res_model">property.accounts.receivable</field>
<field name="view_mode">tree,search</field>
<field name="context">{'search_default_group_lessee_id': 1}</field>
<field name="domain">[('condition', '=', 'invalid')]</field>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'tree', 'view_id': ref('yuthon_property.view_property_accounts_receivable_tree')})]"/>
</record>
<record id="all_button_return_property" model="ir.actions.server">
<field name="name">批量退回</field>
<field name="model_id" ref="yuthon_property.model_property_accounts_receivable"/>
@@ -289,7 +289,7 @@
action="yuthon_property.yuthon_property_project_setting_action"/>
<menuitem id="yuthon_property_contract_wizard_menu"
parent="yuthon_property.yuthon_property_fee_management"
name="生成合同应收向导"
name="生成应收"
action="view_property_rental_action"
sequence="1"/>
@@ -301,37 +301,8 @@
<menuitem id="yuthon_accounts_receivable_menu"
sequence="1"
name="应收账单"
parent="yuthon_property.yuthon_financial_management_menu"/>
<menuitem id="yuthon_property_rent_billing_menu"
sequence="5"
name="已开票"
parent="yuthon_accounts_receivable_menu"
action="view_property_rent_billing_action"/>
<menuitem id="yuthon_property_rent_not_billing_menu"
sequence="8"
name="待开票"
parent="yuthon_accounts_receivable_menu"
action="view_property_rent_not_billing_action"/>
<menuitem id="yuthon_property_rent_reconciliation_menu"
sequence="11"
name="对账"
parent="yuthon_accounts_receivable_menu"
action="view_property_rent_reconciliation_action"/>
<menuitem id="yuthon_property_rent_not_reconciliation_menu"
sequence="14"
name="未对账"
parent="yuthon_accounts_receivable_menu"
action="view_property_rent_not_reconciliation_action"/>
<menuitem id="yuthon_property_rent_red_menu"
sequence="17"
name="红冲"
parent="yuthon_accounts_receivable_menu"
action="view_property_rent_red_action"/>
<menuitem id="yuthon_property_rent_invalid_menu"
sequence="20"
name="作废"
parent="yuthon_accounts_receivable_menu"
action="view_property_rent_invalid_action"/>
parent="yuthon_property.yuthon_financial_management_menu"
action="yuthon_property.view_property_accounts_receivable_tree"/>
<menuitem id="yuthon_property_deposit_list"
sequence="22"
name="押金列表"