diff options
| -rw-r--r-- | indoteknik_custom/models/bill_receipt.py | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/indoteknik_custom/models/bill_receipt.py b/indoteknik_custom/models/bill_receipt.py index 806edc25..39d5f31b 100644 --- a/indoteknik_custom/models/bill_receipt.py +++ b/indoteknik_custom/models/bill_receipt.py @@ -11,24 +11,15 @@ class BillReceipt(models.Model): _rec_name = 'number' number = fields.Char(string='Document No', index=True, copy=False, readonly=True, tracking=True) - vendor_id = fields.Many2one('res.partner', string="Vendor") - document_date = fields.Date(string="Document Date") + vendor_id = fields.Many2one('res.partner', string="Vendor", required=True) + document_date = fields.Date(string="Document Date", required=True) description = fields.Text(string='Description') validated = fields.Boolean(string="Validated", readonly=True) bill_line = fields.One2many('bill.receipt.line', 'bill_id', string='Bill Receipt Lines') - grand_total = fields.Float(string="Grand Total") - - def compute_amt_total_without_service(self): - for order in self: - sum_price_total = 0 - for line in order.order_line: - if line.product_id.type == 'product': - sum_price_total += line.price_total - order.amount_total_without_service = sum_price_total @api.model def create(self, vals): - vals['number'] = self.env['ir.sequence'].next_by_code('due.extension') or '0' + vals['number'] = self.env['ir.sequence'].next_by_code('bill.receipt') or '0' result = super(BillReceipt, self).create(vals) return result @@ -53,8 +44,8 @@ class BillReceiptLine(models.Model): _order = 'bill_id, id' bill_id = fields.Many2one('bill.receipt', string='Bill Receipt') - po_id = fields.Many2one('purchase.order', string='PO') sale_order_id = fields.Many2one('sale.order', string='Sale Order') + po_id = fields.Many2one('purchase.order', string='PO') user_id = fields.Many2one('res.users', string='Purchase Rep') payment_term_id = fields.Many2one('account.payment.term', string='Payment Terms') vendor_id = fields.Many2one('res.partner', string='Vendor') |
