25 lines
841 B
Python
25 lines
841 B
Python
from odoo import models, fields, api, _, SUPERUSER_ID
|
|
from odoo.exceptions import UserError, ValidationError
|
|
|
|
|
|
class BuildFeeWizard(models.TransientModel):
|
|
_name = 'build.fee.wizard'
|
|
_description = '添加物业弹窗'
|
|
|
|
property_ids = fields.Many2many('yuthon.property', string='物业')
|
|
fee_id = fields.Many2one('property.fee.spending', string='费用')
|
|
|
|
def confirm(self):
|
|
property_addresses = [
|
|
prop.name
|
|
for prop in self.property_ids
|
|
if prop.name
|
|
]
|
|
concatenated_address = ', '.join(property_addresses)
|
|
self.fee_id.property_address = concatenated_address
|
|
for prop in self.property_ids:
|
|
self.env['property.fee.spending.line'].create({
|
|
'fee_id': self.fee_id.id,
|
|
'address_id': prop.id,
|
|
})
|