[ADD\ADD security+custom task
This commit is contained in:
parent
3e7599bced
commit
45016f3de6
|
|
@ -84,7 +84,7 @@
|
|||
|
||||
<!-- Add server action to check from due date -->
|
||||
<record id="custom_action_server" model="ir.actions.server">
|
||||
<field name="name">Due Date Server Action</field>
|
||||
<field name="name">Due Date</field>
|
||||
<field name="model_id" ref="property_management.model_rent_payment"/>
|
||||
<field name="binding_model_id" ref="property_management.model_rent_payment"/>
|
||||
<field name="binding_view_types">list</field>
|
||||
|
|
@ -106,7 +106,7 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<record id="custom_invoice_action_server" model="ir.actions.server">
|
||||
<record id="custom_create_invoice_action_server" model="ir.actions.server">
|
||||
<field name="name">Create Commission Vendor Invoice</field>
|
||||
<field name="model_id" ref="property_management.model_rent_payment"/>
|
||||
<field name="binding_model_id" ref="property_management.model_rent_payment"/>
|
||||
|
|
@ -114,7 +114,7 @@
|
|||
<field name="state">code</field>
|
||||
<field name="code">
|
||||
for record in records:
|
||||
record.create_vendor_bill_for_payments()
|
||||
record.action_invoice()
|
||||
</field>
|
||||
</record>
|
||||
<!-- End -->
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ class EndOfRent(models.Model):
|
|||
invoice.write({'invoice_line_ids': commands})
|
||||
rec.invoice_id = invoice.id
|
||||
rec.write({'state': 'done'})
|
||||
elif (rec.insurance_amount == 0.0 or rec.remain_amount==0.0) and !rec.maintenance:
|
||||
elif (rec.insurance_amount == 0.0 or rec.remain_amount==0.0) and not rec.maintenance:
|
||||
rec.write({'state': 'done'})
|
||||
elif (rec.insurance_amount == 0.0 or rec.remain_amount==0.0) and rec.maintenance:
|
||||
invoice_vals = rec._prepare_invoice_values(rec, abs(rec.remain_amount))
|
||||
|
|
|
|||
|
|
@ -3,14 +3,6 @@
|
|||
|
||||
from odoo import models, fields, api, exceptions, tools, _
|
||||
|
||||
class Company(models.Model):
|
||||
_inherit = 'res.company'
|
||||
|
||||
commission_percentage = fields.Float(string='Commission Percentage', help="The commission percentage.")
|
||||
commission_account_id = fields.Many2one('account.account', string='Commission Account', help="The account used to record commissions.")
|
||||
collecting_company_id = fields.Many2one('res.partner', string='Collecting Company', help="The company responsible for collecting the commission.")
|
||||
|
||||
|
||||
class ResConfigSettings(models.TransientModel):
|
||||
_inherit = 'res.config.settings'
|
||||
|
||||
|
|
|
|||
|
|
@ -203,7 +203,6 @@ class RentPayment(models.Model):
|
|||
def create_vendor_bill_for_payments(self):
|
||||
active_ids = self._context.get('active_ids', [])
|
||||
# action = self.env['rent.payment'].browse(context.get('active_ids', []))
|
||||
# payments_to_invoice = action.filtered(lambda p: p.state == 'paid' and p.collected_from_company and not p.invoice_commission_id)
|
||||
payments_to_invoice = self.env['rent.payment'].browse(active_ids).filtered(
|
||||
lambda p: p.state == 'paid' and p.collected_from_company and not p.invoice_commission_id)
|
||||
vendor_id = int(self.env['ir.config_parameter'].sudo().get_param('property_management.collecting_company_id'))
|
||||
|
|
|
|||
Loading…
Reference in New Issue