diff options
| author | Mqdd <ahmadmiqdad27@gmail.com> | 2026-01-15 09:36:37 +0700 |
|---|---|---|
| committer | Mqdd <ahmadmiqdad27@gmail.com> | 2026-01-15 09:36:37 +0700 |
| commit | 3b400df6d9f630c4f20e518126afccf280ff62ac (patch) | |
| tree | b97187aa630c36a6a484d7dee0a918cff6c6d3ba | |
| parent | 4e372aad3010db13453b9e332c6f058fc8375a99 (diff) | |
<Miqdad> fix mail activity nyangkut
| -rw-r--r-- | indoteknik_custom/models/gudang_service.py | 14 | ||||
| -rw-r--r-- | indoteknik_custom/views/gudang_service.xml | 10 |
2 files changed, 18 insertions, 6 deletions
diff --git a/indoteknik_custom/models/gudang_service.py b/indoteknik_custom/models/gudang_service.py index 06d08917..2a8b589d 100644 --- a/indoteknik_custom/models/gudang_service.py +++ b/indoteknik_custom/models/gudang_service.py @@ -86,7 +86,8 @@ class GudangService(models.Model): continue if rec.state == 'done' and rec.done_date: - rec.remaining_date = (rec.done_date.date() - rec.date.date()).days + days = (rec.done_date.date() - rec.date.date()).days + rec.remaining_date = "Since %s days" % days continue rec.remaining_date = (today - rec.date.date()).days @@ -96,10 +97,16 @@ class GudangService(models.Model): for rec in self: rec.state = 'onprogress' rec.date = fields.Datetime.now() - self._send_logistic_notification + self._send_logistic_notification() def action_done(self): for rec in self: + activities = self.env['mail.activity'].search([ + ('res_id', '=', rec.id), + ('res_model', '=', 'gudang.service'), + ('state', '=', 'done') + ]) + activities.unlink() rec.state = 'done' if not rec.done_date: rec.done_date = fields.Datetime.now() @@ -167,9 +174,10 @@ class GudangService(models.Model): class GudangServiceLine(models.Model): _name = "gudang.service.line" + _inherit = ['mail.thread', 'mail.activity.mixin'] product_id = fields.Many2one('product.product', string='Product') quantity = fields.Float(string='Quantity') # picking_id = fields.Many2one('stock.picking', string='Nomor Picking') origin_so = fields.Many2one('sale.order', string='Origin SO') - gudang_service_id = fields.Many2one('gudang.service', string='Gudang Service ID') + gudang_service_id = fields.Many2one('gudang.service', string='Gudang Service ID')
\ No newline at end of file diff --git a/indoteknik_custom/views/gudang_service.xml b/indoteknik_custom/views/gudang_service.xml index a4150452..7fc7109b 100644 --- a/indoteknik_custom/views/gudang_service.xml +++ b/indoteknik_custom/views/gudang_service.xml @@ -12,7 +12,7 @@ decoration-bf="remaining_date > 7" > --> <tree string="Monitoring Gudang Service" - decoration-info="state == 'draft'" decoration-warning="state == 'onprogress'" + decoration-info="state == 'draft'" decoration-danger="state == 'onprogress'" decoration-success="state == 'done'" decoration-muted="state == 'cancel'" > <field name="name"/> @@ -20,7 +20,7 @@ <field name="origin"/> <field name="date"/> <field name="remaining_date"/> - <field name="state" widget="badge" decoration-info="state in ('draft')" decoration-warning="state == 'onprogress'" + <field name="state" widget="badge" decoration-info="state in ('draft')" decoration-danger="state == 'onprogress'" decoration-success="state == 'done'" decoration-muted="state == 'cancel'" /> <!-- <field name="picking_id"/> --> </tree> @@ -76,6 +76,10 @@ </page> </notebook> </sheet> + <div class="oe_chatter"> + <field name="message_follower_ids" widget="mail_followers"/> + <field name="message_ids" widget="mail_thread"/> + </div> </form> </field> </record> @@ -90,7 +94,7 @@ <menuitem id="menu_gudang_service" name="Gudang Service" - parent="sale.sale_order_menu" + parent="indoteknik_custom.menu_monitoring_in_sale" sequence="10" action="action_gudang_service" /> |
